chore: default Cloudron base to 5.0.0; parameterize template with __CLOUDRON_BASE__ and --base option

This commit is contained in:
2025-09-12 14:20:20 -05:00
parent 8bb6d00b0f
commit 02057f7815
3 changed files with 5 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
FROM cloudron/base:4.2.0
FROM cloudron/base:__CLOUDRON_BASE__
# Metadata labels (edit as needed)
LABEL org.opencontainers.image.title="__APP_TITLE__"
@@ -36,4 +36,3 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD curl -fsS http://127.0.0.1:${APP_PORT}/ || exit 1
CMD ["/app/pkg/start.sh"]

View File

@@ -6,6 +6,7 @@ Replace placeholders in files with your app specifics:
- `__APP_ID__` (e.g., com.example.myapp)
- `__APP_TITLE__` (human name)
- `__HTTP_PORT__` (default internal app port)
- `__CLOUDRON_BASE__` (Cloudron base image tag, e.g., 5.0.0)
Files
- `CloudronManifest.json` base manifest
@@ -21,4 +22,3 @@ Usage
`scripts/new-package.sh MyApp --id com.example.myapp --title "My App" --port 3000`
2. Adjust Dockerfile and start.sh to run your app.
3. Build and test locally; then commit and push.

View File

@@ -21,12 +21,14 @@ APP_NAME="$1"; shift
APP_ID="com.example.${APP_NAME,,}"
APP_TITLE="$APP_NAME"
HTTP_PORT="3000"
BASE_TAG="5.0.0"
while [[ $# -gt 0 ]]; do
case "$1" in
--id) APP_ID="$2"; shift 2;;
--title) APP_TITLE="$2"; shift 2;;
--port) HTTP_PORT="$2"; shift 2;;
--base) BASE_TAG="$2"; shift 2;;
-h|--help) usage; exit 0;;
*) echo "Unknown argument: $1"; usage; exit 1;;
esac
@@ -46,8 +48,8 @@ find "$DEST_DIR" -type f \( -name "*" ! -name "*.png" \) -print0 | while IFS= re
sed -i "s#__APP_ID__#${APP_ID}#g" "$f"
sed -i "s#__APP_TITLE__#${APP_TITLE}#g" "$f"
sed -i "s#__HTTP_PORT__#${HTTP_PORT}#g" "$f"
sed -i "s#__CLOUDRON_BASE__#${BASE_TAG}#g" "$f"
done
echo "Created package at: $DEST_DIR"
echo "Next steps: edit Dockerfile and start.sh to run your app. Add logo.png if desired."