-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
52 lines (51 loc) · 1.79 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
52 lines (51 loc) · 1.79 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
# prod 배포용 compose — EC2에서 SSM Run Command가 infra/deploy.sh를 통해 실행.
#
# deploy.sh가 SSM Parameter Store(/blt/prod/*)에서 아래 두 파일을 생성하며 레포에 커밋하지 않는다.
# - .env : compose 보간 + nginx 전용 (ECR_IMAGE, IMAGE_TAG, ORIGIN_SECRET)
# - app.env : app 런타임 주입 (DB_*, JWT_*, APPLE_*, SENTRY_DSN, CORS_*, FCM_* 등)
# ORIGIN_SECRET·ECR_IMAGE·IMAGE_TAG는 app이 쓰지 않으므로 app.env에서 제외(최소 권한).
services:
app:
image: ${ECR_IMAGE}:${IMAGE_TAG}
container_name: blt-app-prod
restart: unless-stopped
env_file:
- app.env
environment:
SPRING_PROFILES_ACTIVE: prod
FCM_CREDENTIALS_PATH: /secrets/blt-firebase-adminsdk.json
volumes:
# deploy.sh가 SSM의 fcm-credentials-json을 이 파일로 써둔다.
- ./secrets/fcm.json:/secrets/blt-firebase-adminsdk.json:ro
expose:
- "8080" # 호스트로 노출하지 않음 — nginx만 접근
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/8080"]
interval: 15s
timeout: 3s
retries: 5
start_period: 60s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
nginx:
image: nginx:1.27-alpine
container_name: blt-nginx-prod
restart: unless-stopped
depends_on:
app:
condition: service_healthy
ports:
- "80:80" # SG inbound 80 = CloudFront origin-facing prefix list만 허용
environment:
ORIGIN_SECRET: ${ORIGIN_SECRET}
NGINX_ENVSUBST_FILTER: ORIGIN_SECRET
volumes:
- ./infra/nginx/nginx.conf.template:/etc/nginx/templates/default.conf.template:ro
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"