Skip to content

Commit f3c9f0c

Browse files
committed
chore(common): add procfile support and default file lookup
1 parent f56f125 commit f3c9f0c

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

bin/release

100644100755
Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
#!/usr/bin/env bash
22
# Release script for Python buildpack with uv support
33

4+
# If the app provides its own Procfile, let Cloud Foundry use that.
5+
if [ -f "Procfile" ]; then
6+
exit 0
7+
# Otherwise, choose a reasonable default entrypoint based on common app files.
8+
elif [ -f "main.py" ]; then
9+
DEFAULT_WEB_PROCESS="python main.py"
10+
elif [ -f "app.py" ]; then
11+
DEFAULT_WEB_PROCESS="python app.py"
12+
else
13+
DEFAULT_WEB_PROCESS="python -m uvicorn main:app --host 0.0.0.0 --port \${PORT:-8000}"
14+
fi
15+
416
cat <<EOF
517
---
618
default_process_types:
7-
web: python app.py
19+
web: ${DEFAULT_WEB_PROCESS}
820
EOF

0 commit comments

Comments
 (0)