-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocker-compose.prod-local.yml
More file actions
89 lines (83 loc) · 2.28 KB
/
Copy pathdocker-compose.prod-local.yml
File metadata and controls
89 lines (83 loc) · 2.28 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
85
86
87
88
89
# Local production-like testing stack
# Usage: docker compose -f docker-compose.prod-local.yml up --build -d
#
# Mirrors Lightsail production topology:
# - PostgreSQL 17 (like native PG on Lightsail)
# - Two API containers for blue/green testing
# - Nginx reverse proxy with upstream switching
services:
postgres:
image: postgres:17-alpine
container_name: lrda-prod-local-pg
restart: unless-stopped
ports:
- "5434:5432"
environment:
POSTGRES_USER: lrda_app
POSTGRES_PASSWORD: lrda_local_prod
POSTGRES_DB: lrda_production
volumes:
- prod_local_pg_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U lrda_app -d lrda_production"]
interval: 5s
timeout: 3s
retries: 5
networks:
- lrda-prod-local
api-blue:
build:
context: .
dockerfile: packages/api/Dockerfile
container_name: lrda-api-blue
ports:
- "3002:3002"
environment:
NODE_ENV: production
PORT: 3002
DATABASE_URL: postgresql://lrda_app:lrda_local_prod@postgres:5432/lrda_production
BETTER_AUTH_SECRET: local-prod-testing-secret-not-real
BETTER_AUTH_URL: http://localhost:3002
CORS_ORIGINS: http://localhost:3000,http://localhost:8080
depends_on:
postgres:
condition: service_healthy
networks:
- lrda-prod-local
api-green:
build:
context: .
dockerfile: packages/api/Dockerfile
container_name: lrda-api-green
ports:
- "3003:3002"
environment:
NODE_ENV: production
PORT: 3002
DATABASE_URL: postgresql://lrda_app:lrda_local_prod@postgres:5432/lrda_production
BETTER_AUTH_SECRET: local-prod-testing-secret-not-real
BETTER_AUTH_URL: http://localhost:3003
CORS_ORIGINS: http://localhost:3000,http://localhost:8080
depends_on:
postgres:
condition: service_healthy
profiles:
- green
networks:
- lrda-prod-local
nginx:
image: nginx:alpine
container_name: lrda-prod-local-nginx
ports:
- "8080:80"
volumes:
- ./infrastructure/nginx/local.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- api-blue
networks:
- lrda-prod-local
volumes:
prod_local_pg_data:
networks:
lrda-prod-local:
driver: bridge