From 6705f7bff97aed3d43541e0c6d80dcb152ff1932 Mon Sep 17 00:00:00 2001 From: saulteafarmer Date: Wed, 14 May 2025 16:27:12 +0000 Subject: [PATCH] Update docker-compose.yml --- docker-compose.yml | 49 ++++++++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 544ae96..d9d2123 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,33 @@ +# docker-compose.yml version: "3.8" + services: - bot: - build: . - container_name: discord-lnbits-bot + + # ── Database ──────────────────────────────────────────────────────────────── + db: + image: postgres:15-alpine + container_name: lnbits_db env_file: - .env - depends_on: - db: - condition: service_healthy + environment: + # these come from your .env: + POSTGRES_USER: ${DB_USER} + POSTGRES_PASSWORD: ${DB_PASS} + POSTGRES_DB: ${DB_NAME} + volumes: + - postgres_data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"] + interval: 10s + timeout: 5s + retries: 5 restart: unless-stopped + # ── Web UI ────────────────────────────────────────────────────────────────── web: - build: . + build: + context: . + dockerfile: Dockerfile.web # or your one‐and‐only Dockerfile if you merge them container_name: discord-lnbits-web env_file: - .env @@ -20,20 +36,19 @@ services: condition: service_healthy ports: - "3000:3000" - command: gunicorn -b 0.0.0.0:3000 app:app restart: unless-stopped - db: - image: postgres:15-alpine - container_name: lnbits_db + # ── Discord Bot ───────────────────────────────────────────────────────────── + bot: + build: + context: . + dockerfile: Dockerfile # your existing Dockerfile for the Python bot + container_name: discord-lnbits-bot env_file: - .env - volumes: - - postgres_data:/var/lib/postgresql/data - healthcheck: - test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"] - interval: 10s - retries: 5 + depends_on: + db: + condition: service_healthy restart: unless-stopped volumes: