-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
84 lines (79 loc) · 2.29 KB
/
docker-compose.prod.yml
File metadata and controls
84 lines (79 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-alembic}
POSTGRES_USER: ${POSTGRES_USER:-alembic}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-alembic_prod}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-alembic}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- alembic-net
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PASSWORD:-alembic_redis}
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD:-alembic_redis}", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- alembic-net
backend:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
environment:
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-alembic}:${POSTGRES_PASSWORD:-alembic_prod}@postgres:5432/${POSTGRES_DB:-alembic}
REDIS_URL: redis://:${REDIS_PASSWORD:-alembic_redis}@redis:6379/0
APP_ENV: ${APP_ENV:-production}
APP_DEBUG: ${APP_DEBUG:-false}
LOG_LEVEL: ${LOG_LEVEL:-info}
FRAGELLA_API_KEY: ${FRAGELLA_API_KEY:-}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is required}
JWT_EXPIRE_MINUTES: ${JWT_EXPIRE_MINUTES:-15}
JWT_REFRESH_EXPIRE_DAYS: ${JWT_REFRESH_EXPIRE_DAYS:-7}
CORS_ORIGINS: ${CORS_ORIGINS:-}
RATE_LIMIT_LOGIN: ${RATE_LIMIT_LOGIN:-5}
RATE_LIMIT_COMPOSE: ${RATE_LIMIT_COMPOSE:-20}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "python3", "-c", "import httpx; r = httpx.get('http://localhost:8000/health'); assert r.status_code == 200"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
networks:
- alembic-net
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
restart: unless-stopped
ports:
- "${APP_PORT:-80}:80"
depends_on:
- backend
networks:
- alembic-net
volumes:
pgdata:
redisdata:
networks:
alembic-net:
driver: bridge