38 lines
1002 B
YAML
38 lines
1002 B
YAML
services:
|
|
postgres:
|
|
image: postgres:15.1
|
|
restart: always
|
|
volumes:
|
|
- ./postgres_data:/var/lib/postgresql/data/:rw
|
|
environment:
|
|
POSTGRES_USER: user
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_DB: db
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -d db --user user"]
|
|
interval: 2s
|
|
timeout: 2s
|
|
retries: 5
|
|
ports:
|
|
- 5432
|
|
bot:
|
|
build:
|
|
context: bot
|
|
environment:
|
|
DIALECT: postgresql
|
|
DRIVER: psycopg2
|
|
USER: user
|
|
PASSWORD: password
|
|
DB_NAME: db
|
|
HOST: postgres
|
|
PORT: 5432
|
|
restart: always
|
|
volumes:
|
|
- ./persistent_data/.state-save:/app/.state-save:rw
|
|
- ./bot/app:/app:z
|
|
ports:
|
|
- "4444:4444" # debugger port
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|