29 lines
604 B
YAML
29 lines
604 B
YAML
version: "3.9"
|
|
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: ${DB_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
|
|
POSTGRES_DB: ${DB_NAME:-tg_poster}
|
|
ports:
|
|
- "${DB_PORT:-5432}:5432"
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
bot:
|
|
build: .
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
env_file: .env
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
pgdata:
|