set DATABASE_URL
This commit is contained in:
parent
3846cae6ca
commit
3bfca5a726
@ -11,6 +11,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
APP="firehose" # <-- change to your desired Dokku app name / hostname
|
APP="firehose" # <-- change to your desired Dokku app name / hostname
|
||||||
|
DB_NAME="firehose_db" # <-- valid chars: [A-Za-z0-9_] only
|
||||||
PHX_HOST="$APP" # <-- change to your full domain, e.g., firehose.example.com
|
PHX_HOST="$APP" # <-- change to your full domain, e.g., firehose.example.com
|
||||||
|
|
||||||
# Auto-generate secrets
|
# Auto-generate secrets
|
||||||
@ -20,8 +21,8 @@ echo "==> Creating Dokku app: $APP"
|
|||||||
dokku apps:create "$APP" || echo "App may already exist"
|
dokku apps:create "$APP" || echo "App may already exist"
|
||||||
|
|
||||||
echo "==> Creating PostgreSQL database"
|
echo "==> Creating PostgreSQL database"
|
||||||
dokku postgres:create "${APP}-db" || echo "Database may already exist"
|
dokku postgres:create "${DB_NAME}" || echo "Database may already exist"
|
||||||
dokku postgres:link "${APP}-db" "$APP" || echo "Database may already be linked"
|
dokku postgres:link "${DB_NAME}" "$APP" || echo "Database may already be linked"
|
||||||
|
|
||||||
echo "==> Setting environment variables"
|
echo "==> Setting environment variables"
|
||||||
dokku config:set --no-restart "$APP" \
|
dokku config:set --no-restart "$APP" \
|
||||||
@ -29,21 +30,18 @@ dokku config:set --no-restart "$APP" \
|
|||||||
PHX_HOST="$PHX_HOST" \
|
PHX_HOST="$PHX_HOST" \
|
||||||
PORT="4000"
|
PORT="4000"
|
||||||
|
|
||||||
# Optional: set custom domain (uncomment and edit)
|
|
||||||
# dokku domains:set "$APP" "$PHX_HOST"
|
|
||||||
|
|
||||||
# Optional: set up SSL with Let's Encrypt (uncomment)
|
|
||||||
# dokku letsencrypt:enable "$APP"
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "==> Setup complete!"
|
echo "==> Setup complete!"
|
||||||
echo ""
|
echo ""
|
||||||
|
echo "DATABASE_URL was set automatically by postgres:link."
|
||||||
|
echo ""
|
||||||
echo "Next steps:"
|
echo "Next steps:"
|
||||||
echo " 1. From your local machine, add the git remote:"
|
echo " 1. From your local machine, add the git remote:"
|
||||||
echo " git remote add dokku dokku@YOUR_SERVER:$APP"
|
echo " git remote add dokku dokku@YOUR_SERVER:$APP"
|
||||||
echo ""
|
echo ""
|
||||||
echo " 2. Push to deploy:"
|
echo " 2. Push to deploy:"
|
||||||
echo " git push dokku main"
|
echo " git push dokku main"
|
||||||
|
echo " (migrations run automatically via app.json postdeploy)"
|
||||||
echo ""
|
echo ""
|
||||||
echo " 3. Run migrations (first deploy):"
|
echo " 3. Set up SSL (after first deploy):"
|
||||||
echo " dokku run $APP /app/bin/migrate"
|
echo " dokku letsencrypt:enable $APP"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user