chore(*): adopt project templates

This commit is contained in:
hh
2026-09-09 01:17:12 +02:00
parent 5ec0212af5
commit ccbc167005
33 changed files with 409 additions and 220 deletions
+107
View File
@@ -0,0 +1,107 @@
services:
api:
build: backend
image: beavergram/backend
profiles: [api, services]
restart: unless-stopped
env_file:
- path: .env
required: false
- path: backend/.env
required: false
environment:
RUN_ENVIRONMENT: prod
TZ: ${TZ:-UTC}
STORAGE__ROOT: /app/storage
volumes:
- ./backend/src:/app/src
- ./backend/scripts:/app/scripts
- ./backend/sessions:/app/sessions
- ./frontend/build:/app/static:ro
- ${STORAGE__ROOT:-./storage}:/app/storage
command: [api]
depends_on:
postgres:
condition: service_healthy
required: false
networks:
default:
database:
userbot:
build: backend
image: beavergram/backend
profiles: [userbot, services]
restart: unless-stopped
env_file:
- path: .env
required: false
- path: backend/.env
required: false
environment:
RUN_ENVIRONMENT: prod
TZ: ${TZ:-UTC}
STORAGE__ROOT: /app/storage
volumes:
- ./backend/src:/app/src
- ./backend/scripts:/app/scripts
- ./backend/sessions:/app/sessions
- ${STORAGE__ROOT:-./storage}:/app/storage
command: [userbot]
depends_on:
postgres:
condition: service_healthy
required: false
networks:
database:
postgres:
image: timescale/timescaledb:2.27.1-pg17
profiles: [postgres, external]
restart: unless-stopped
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
networks:
database:
aliases:
- ${DB__HOST:-postgres}
migrator:
build: backend
image: beavergram/backend
profiles: [migrate]
env_file:
- path: .env
required: false
- path: backend/.env
required: false
environment:
RUN_ENVIRONMENT: prod
volumes:
- ./backend/src:/app/src
- ./backend/migrations:/app/migrations
- ./backend/alembic.ini:/app/alembic.ini
entrypoint: [alembic]
command: [upgrade, head]
depends_on:
postgres:
condition: service_healthy
required: false
networks:
database:
volumes:
pgdata:
networks:
database: