77 lines
1.8 KiB
YAML
77 lines
1.8 KiB
YAML
services:
|
|
postgres:
|
|
image: timescale/timescaledb:2.27.1-pg17
|
|
profiles: [db]
|
|
environment:
|
|
POSTGRES_USER: ${DB__USER:-beavergram}
|
|
POSTGRES_PASSWORD: ${DB__PASSWORD:-beavergram}
|
|
POSTGRES_DB: ${DB__DB_NAME:-beavergram}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
- ./backend/migrations/init:/docker-entrypoint-initdb.d:ro
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${DB__USER:-beavergram}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
userbot:
|
|
build: ./backend
|
|
profiles: [userbot]
|
|
command: [userbot]
|
|
env_file:
|
|
- path: backend/.env
|
|
required: false
|
|
- path: .env
|
|
required: false
|
|
environment:
|
|
RUN_ENVIRONMENT: prod
|
|
volumes:
|
|
- ./backend/src:/app/src
|
|
- ./backend/sessions:/app/sessions
|
|
- ${STORAGE__ROOT:-./storage}:/app/storage
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
api:
|
|
build: ./backend
|
|
profiles: [api]
|
|
command: [api]
|
|
env_file:
|
|
- path: backend/.env
|
|
required: false
|
|
- path: .env
|
|
required: false
|
|
environment:
|
|
RUN_ENVIRONMENT: prod
|
|
volumes:
|
|
- ./backend/src:/app/src
|
|
- ${STORAGE__ROOT:-./storage}:/app/storage
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
migrator:
|
|
build: ./backend
|
|
profiles: [migrate]
|
|
env_file:
|
|
- path: backend/.env
|
|
required: false
|
|
- path: .env
|
|
required: false
|
|
environment:
|
|
RUN_ENVIRONMENT: prod
|
|
volumes:
|
|
- ./backend/src:/app/src
|
|
- ./backend/migrations:/app/migrations
|
|
- ./backend/alembic.ini:/app/alembic.ini
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
entrypoint: [alembic]
|
|
command: [upgrade, head]
|
|
|
|
volumes:
|
|
pgdata:
|