Update docker-compose.yml
This commit is contained in:
parent
4d2262e48f
commit
4b30c18310
@ -2,7 +2,7 @@ version: "3.8"
|
||||
|
||||
services:
|
||||
|
||||
# ── Postgres ────────────────────────────────────────────────────────────────
|
||||
# ── Postgres Database ───────────────────────────────────────────────────────
|
||||
db:
|
||||
image: postgres:15-alpine
|
||||
container_name: lnbits_db
|
||||
@ -25,14 +25,22 @@ services:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: discord-lnbits-web
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
DATABASE_URL: "${DATABASE_URL}"
|
||||
FLASK_SECRET: "${FLASK_SECRET}"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- db
|
||||
# wait for Postgres then launch Gunicorn
|
||||
command: >
|
||||
sh -c '
|
||||
until pg_isready -h db -U "${DB_USER}" ; do
|
||||
echo "[web] waiting for db…" ;
|
||||
sleep 2 ;
|
||||
done ;
|
||||
exec gunicorn -b 0.0.0.0:3000 app:app
|
||||
'
|
||||
restart: unless-stopped
|
||||
|
||||
# ── Discord Lightning Bot ──────────────────────────────────────────────────
|
||||
@ -53,8 +61,16 @@ services:
|
||||
INVOICE_MESSAGE: "${INVOICE_MESSAGE}"
|
||||
DATABASE_URL: "${DATABASE_URL}"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
- db
|
||||
# wait for Postgres as well, then launch the bot
|
||||
command: >
|
||||
sh -c '
|
||||
until pg_isready -h db -U "${DB_USER}" ; do
|
||||
echo "[bot] waiting for db…" ;
|
||||
sleep 2 ;
|
||||
done ;
|
||||
exec python3 discord_lnbits_bot.py
|
||||
'
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
|
Loading…
x
Reference in New Issue
Block a user