version: "3.8" services: bot: build: context: . dockerfile: dockerfile pull_policy: build restart: always environment: - DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?sslmode=disable - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN} - BOT_OWNER_ID=${BOT_OWNER_ID} depends_on: postgres: condition: service_healthy networks: - bot-net postgres: image: postgres:16-alpine restart: always environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 5s timeout: 5s retries: 5 networks: - bot-net volumes: postgres_data: networks: bot-net: external: true