-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add heroku 1-click deployment files #383
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "Postiz", | ||
"description": "Self-hosted content management platform", | ||
"keywords": ["node", "express", "next.js", "cms", "headless-cms"], | ||
"website": "https://github.com/gitroomhq/postiz-app", | ||
"repository": "https://github.com/gitroomhq/postiz-app", | ||
"logo": "https://raw.githubusercontent.com/gitroomhq/postiz-app/main/apps/frontend/public/logo.png", | ||
"success_url": "/", | ||
"stack": "container", | ||
"env": { | ||
"NODE_ENV": { | ||
"description": "Environment type", | ||
"value": "production" | ||
}, | ||
"JWT_SECRET": { | ||
"description": "Secret key for JWT tokens", | ||
"generator": "secret" | ||
}, | ||
"ADMIN_PASSWORD": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is this? |
||
"description": "Initial admin password", | ||
"generator": "secret" | ||
}, | ||
"DATABASE_URL": { | ||
"description": "DATABASE_URL for Postgres connection", | ||
"required": true | ||
}, | ||
"REDIS_URL": { | ||
"description": "REDIS_URL for Redis connection", | ||
"required": true | ||
}, | ||
"APP_URL": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is this used? |
||
"description": "Application URL (will be auto-filled)", | ||
"required": true | ||
} | ||
}, | ||
"addons": [ | ||
{ | ||
"plan": "heroku-postgresql:hobby-dev", | ||
"as": "DATABASE" | ||
}, | ||
{ | ||
"plan": "heroku-redis:hobby-dev", | ||
"as": "REDIS" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
setup: | ||
addons: | ||
- plan: heroku-postgresql:hobby-dev | ||
as: DATABASE | ||
- plan: heroku-redis:hobby-dev | ||
as: REDIS | ||
|
||
build: | ||
docker: | ||
web: ghcr.io/gitroomhq/postiz-app-enterprise:latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You shouldn't use the enterprise containers. |
||
config: | ||
NODE_ENV: production | ||
|
||
run: | ||
web: /app/entrypoint.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,33 @@ | |
|
||
set -o xtrace | ||
|
||
export DATABSAE_URL=${DATABASE_URL:-$HEROKU_POSTGRESQL_DATABASE_URL} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Waiting for the database should be handled on the platform level. |
||
export REDIS_URL=${REDIS_URL:-$HEROKU_REDIS_URL} | ||
|
||
wait_for_service() { | ||
echo "Waiting for $1 to be ready..." | ||
until $2; do | ||
echo "Waiting for $1 is not ready - sleeping" | ||
sleep 1 | ||
done | ||
echo "$1 is ready!" | ||
} | ||
|
||
if [[ -n "$DATABASE_URL" ]]; then | ||
wait_for_service "PostgreSQL" "pg_isready -h $(echo $DATABASE_URL | cut -d@ -f2 | cut -d/ -f1) -p 5432" | ||
fi | ||
|
||
if [[ -n "$REDIS_URL" ]]; then | ||
wait_for_service "Redis" "redis-cli -u $REDIS_URL ping" | ||
fi | ||
npm run prisma-db-push | ||
if [[ "$SKIP_CONFIG_CHECK" != "true" ]]; then | ||
echo "Entrypoint: Copying /config/postiz.env into /app/.env" | ||
|
||
cp -vf /app/supervisord_available_configs/caddy.conf /etc/supervisor.d/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing these lines will break the existing docker containers. |
||
if [ ! -f /config/postiz.env ]; then | ||
echo "Entrypoint: WARNING: No postiz.env file found in /config/postiz.env" | ||
fi | ||
|
||
ln -sf /app/supervisord_available_configs/frontend.conf /etc/supervisor.d/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same with this line. |
||
cp -vf /config/postiz.env /app/.env | ||
fi | ||
|
||
|
@@ -17,6 +37,12 @@ if [[ "$POSTIZ_APPS" -eq "" ]]; then | |
POSTIZ_APPS="frontend workers cron backend" | ||
fi | ||
|
||
if [[$POSTIZ_APPS == *"workers"* ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These lines just look wrong. |
||
if [[ "$POSTIZ_APPS" -ep "" ]]; then | ||
POSTIZ_APPS="frontend workers cron backend" | ||
fi | ||
ln -sf /app/supervisord_available_configs/cron.conf /etc/supervisor.d/ | ||
|
||
echo "Entrypoint: Running database migrations" | ||
npm run prisma-db-push | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't change the enterprise container workflows.