36 lines
852 B
YAML
36 lines
852 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:14-alpine
|
|
container_name: bdbot_postgres
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: bdbot
|
|
ports:
|
|
- "5432:5432"
|
|
# Persist data in a local folder ./postgres_data
|
|
volumes:
|
|
- ./postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
bot:
|
|
build: .
|
|
container_name: bdbot
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
BOT_TOKEN: ${BOT_TOKEN}
|
|
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/bdbot
|
|
NOTIFICATION_TIME: ${NOTIFICATION_TIME:-09:00}
|
|
TIMEZONE: ${TIMEZONE:-UTC}
|
|
env_file:
|
|
- .env
|
|
restart: unless-stopped
|