Initial commit: site monorepo with API, web, and infra.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
влад
2026-07-16 10:11:54 +03:00
co-authored by Cursor
commit 016910ffb7
447 changed files with 73972 additions and 0 deletions
+135
View File
@@ -0,0 +1,135 @@
# Production stack — VPS deploy.
# Usage:
# python apps/api/scripts/bootstrap_install.py
# cp infra/docker/.env.production.example infra/docker/.env.production
# docker compose -f infra/docker/docker-compose.prod.yml --env-file infra/docker/.env.production up -d --build
services:
postgres:
image: postgres:16
restart: unless-stopped
env_file:
- ../../apps/api/data/secrets/install.env
volumes:
- prod_postgres_data:/var/lib/postgresql/data
networks:
- internal
redis:
image: redis:7-alpine
restart: unless-stopped
networks:
- internal
minio:
image: minio/minio
restart: unless-stopped
command: server /data --console-address ":9001"
env_file:
- ../../apps/api/data/secrets/install.env
volumes:
- prod_minio_data:/data
networks:
- internal
api:
build:
context: ../../apps/api
dockerfile: Dockerfile
restart: unless-stopped
environment:
APP_ENV: production
ENABLE_DOCS: "false"
ENABLE_TEST_ROUTES: "false"
COOKIE_SECURE: "true"
ENABLE_RATE_LIMIT: "true"
EMAIL_DELIVERY_MODE: smtp
STORAGE_MODE: s3
S3_ENDPOINT: http://minio:9000
REDIS_URL: redis://redis:6379/0
SEED_DEMO_USERS: "false"
env_file:
- ../../apps/api/data/secrets/install.env
- .env.production
volumes:
- ../../apps/api/data/secrets:/app/data/secrets
- prod_api_logs:/app/data/logs
depends_on:
- postgres
- redis
- minio
networks:
- internal
web:
build:
context: ../..
dockerfile: apps/web/Dockerfile
restart: unless-stopped
environment:
VITE_USE_API_PROXY: "true"
VITE_API_URL: http://api:8000
depends_on:
- api
networks:
- internal
nginx:
image: nginx:stable-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ../nginx/default.tls.conf:/etc/nginx/conf.d/default.conf:ro
- ${TLS_CERT_DIR:-./certs}:/etc/nginx/certs:ro
depends_on:
- web
- api
networks:
- internal
worker:
build:
context: ../../apps/api
dockerfile: Dockerfile
restart: unless-stopped
command: ["python", "-m", "app.worker"]
environment:
APP_ENV: production
CELERY_BROKER_URL: redis://redis:6379/0
env_file:
- ../../apps/api/data/secrets/install.env
- .env.production
depends_on:
- postgres
- redis
networks:
- internal
celery-worker:
build:
context: ../../apps/api
dockerfile: Dockerfile
restart: unless-stopped
command: ["celery", "-A", "app.celery_app", "worker", "--loglevel=info"]
environment:
APP_ENV: production
CELERY_BROKER_URL: redis://redis:6379/0
env_file:
- ../../apps/api/data/secrets/install.env
- .env.production
depends_on:
- postgres
- redis
networks:
- internal
networks:
internal:
driver: bridge
volumes:
prod_postgres_data:
prod_minio_data:
prod_api_logs: