services:
postgres:
image: postgres:16
container_name: postgres_agent_db
environment:
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
ports:
- "5633:5432"
volumes:
- ./data/postgres/postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
start_period: 30s
redis:
image: redis:latest
container_name: redis_agent
ports:
- "6380:6379"
volumes:
- ./data/redis/data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
bot:
build:
context: .
dockerfile: Dockerfile
container_name: bot_agent
env_file: .env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./data/images:/app/images
restart: unless-stopped
# Uncomment the fastapi service below if you need the payment module (pay mode).
# NOTE: requires the payment_module/ directory to exist in the project root.
# fastapi:
# build:
# context: .
# dockerfile: Dockerfile_fastapi
# container_name: fastapi_agent
# env_file: .env
# ports:
# - "8001:8000"
# depends_on:
# postgres:
# condition: service_healthy
# redis:
# condition: service_healthy