max-telegram-bridge-bot/docker-compose.yml
Andrey Lugovskoy 1b5e81ca98 Use env vars for Postgres config in docker-compose
POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB configurable
via .env with defaults. Updated .env.example with all options.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 13:01:59 +03:00

28 lines
744 B
YAML

services:
bridge:
build: .
restart: unless-stopped
env_file: .env
environment:
DATABASE_URL: postgres://${POSTGRES_USER:-bridge}:${POSTGRES_PASSWORD:-bridge}@postgres:5432/${POSTGRES_DB:-bridge}?sslmode=disable
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-bridge}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-bridge}
POSTGRES_DB: ${POSTGRES_DB:-bridge}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-bridge}"]
interval: 5s
timeout: 3s
retries: 5
volumes:
pgdata: