discord-lnbits-bot/docker-compose.yml

56 lines
1.7 KiB
YAML
Raw Normal View History

2025-05-14 16:27:12 +00:00
# docker-compose.yml
2025-05-14 16:12:15 +00:00
version: "3.8"
2025-05-14 16:27:12 +00:00
2025-05-11 00:01:04 +00:00
services:
2025-05-14 16:27:12 +00:00
# ── Database ────────────────────────────────────────────────────────────────
db:
image: postgres:15-alpine
container_name: lnbits_db
2025-05-11 00:01:04 +00:00
env_file:
2025-05-14 16:26:51 +00:00
- .env
2025-05-14 16:27:12 +00:00
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
2025-05-14 16:12:15 +00:00
restart: unless-stopped
2025-05-14 15:10:17 +00:00
2025-05-14 16:27:12 +00:00
# ── Web UI ──────────────────────────────────────────────────────────────────
2025-05-14 15:10:17 +00:00
web:
2025-05-14 16:27:12 +00:00
build:
context: .
dockerfile: Dockerfile.web # or your oneandonly Dockerfile if you merge them
2025-05-14 16:12:15 +00:00
container_name: discord-lnbits-web
2025-05-14 15:10:17 +00:00
env_file:
2025-05-14 16:26:51 +00:00
- .env
depends_on:
db:
condition: service_healthy
2025-05-14 16:12:15 +00:00
ports:
- "3000:3000"
restart: unless-stopped
2025-05-11 00:01:04 +00:00
2025-05-14 16:27:12 +00:00
# ── Discord Bot ─────────────────────────────────────────────────────────────
bot:
build:
context: .
dockerfile: Dockerfile # your existing Dockerfile for the Python bot
container_name: discord-lnbits-bot
2025-05-14 16:26:51 +00:00
env_file:
- .env
2025-05-14 16:27:12 +00:00
depends_on:
db:
condition: service_healthy
2025-05-14 16:12:15 +00:00
restart: unless-stopped
2025-05-11 00:01:04 +00:00
volumes:
2025-05-14 16:26:51 +00:00
postgres_data: