Files
beavergram/docker-compose.yml
T
2026-06-02 01:22:58 +02:00

92 lines
2.2 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]
frontend-dev:
image: oven/bun:1
profiles: [frontend]
working_dir: /app
command: ["sh", "-c", "bun install && bun run dev --host 0.0.0.0 --port 5173"]
environment:
API_PROXY_TARGET: http://api:8080
ALLOWED_HOSTS: ${FRONTEND_DEV_HOST:-}
volumes:
- ./frontend:/app
- frontend_node_modules:/app/node_modules
- frontend_svelte_kit:/app/.svelte-kit
volumes:
pgdata:
frontend_node_modules:
frontend_svelte_kit: