-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
161 lines (151 loc) · 6.14 KB
/
docker-compose.yml
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
version: "3"
services:
taxi-front:
container_name: taxi-front
restart: always
image: ${FRONT_IMAGE:-666583083672.dkr.ecr.ap-northeast-2.amazonaws.com/taxi-front:latest}
networks:
- proxy
environment:
- REACT_APP_FRONT_URL=${FRONT_URL:-https://taxi.sparcs.org}
- REACT_APP_BACK_URL=${BACK_URL:-https://taxi.sparcs.org/api}
- REACT_APP_IO_URL=${IO_URL:-https://taxi.sparcs.org}
- REACT_APP_OG_URL=${OG_URL:-https://og-image.taxi.sparcs.org}
- REACT_APP_S3_URL=${S3_URL:-https://sparcs-taxi-prod.s3.ap-northeast-2.amazonaws.com}
- REACT_APP_CHANNELTALK_PLUGIN_KEY=${CHANNELTALK_PLUGIN_KEY}
- REACT_APP_KAKAO_SDK_KEY=${KAKAO_SDK_KEY}
- REACT_APP_GA_TRACKING_ID=${GA_TRACKING_ID}
- REACT_APP_FIREBASE_CONFIG=${FIREBASE_CONFIG}
labels:
- "com.centurylinklabs.watchtower.scope=taxi"
- 'com.centurylinklabs.watchtower.lifecycle.pre-update=curl -X POST -H ''Content-type: application/json'' --data ''{"text":"[PROD] 업데이트를 위해 taxi-front 서비스를 종료시켰습니다."}'' ${SLACK_WATCHTOWER_WEBHOOK}'
- 'com.centurylinklabs.watchtower.lifecycle.post-update=curl -X POST -H ''Content-type: application/json'' --data ''{"text":"[PROD] 업데이트 후 taxi-front 서비스를 재시작하였습니다."}'' ${SLACK_WATCHTOWER_WEBHOOK}'
taxi-back:
container_name: taxi-back
restart: always
image: ${BACK_IMAGE:-666583083672.dkr.ecr.ap-northeast-2.amazonaws.com/taxi-back:latest}
depends_on:
- taxi-mongo
- taxi-redis
networks:
- proxy
- backend
environment:
- SESSION_KEY=${SESSION_KEY:?err}
- SPARCSSSO_CLIENT_ID=${SPARCSSSO_CLIENT_ID}
- SPARCSSSO_CLIENT_KEY=${SPARCSSSO_CLIENT_KEY}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:?err}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:?err}
- AWS_S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME:-sparcs-taxi-prod}
- JWT_SECRET_KEY=${JWT_SECRET_KEY:?err}
- GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS}
- TEST_ACCOUNTS=${TEST_ACCOUNTS:-["[email protected]","[email protected]"]}
- SLACK_REPORT_WEBHOOK_URL=${SLACK_REPORT_WEBHOOK_URL}
- DB_PATH=mongodb://taxi-mongo:27017/taxi
- REDIS_PATH=redis://taxi-redis:6379
labels:
- "com.centurylinklabs.watchtower.scope=taxi"
- 'com.centurylinklabs.watchtower.lifecycle.pre-update=curl -X POST -H ''Content-type: application/json'' --data ''{"text":"[PROD] 업데이트를 위해 taxi-back 서비스를 종료시켰습니다."}'' ${SLACK_WATCHTOWER_WEBHOOK}'
- 'com.centurylinklabs.watchtower.lifecycle.post-update=curl -X POST -H ''Content-type: application/json'' --data ''{"text":"[PROD] 업데이트 후 taxi-back 서비스를 재시작하였습니다."}'' ${SLACK_WATCHTOWER_WEBHOOK}'
volumes:
- taxi-back-logs:/usr/src/app/logs:rw
taxi-og-generator:
container_name: taxi-og-generator
restart: always
image: ${OG_IMAGE:-666583083672.dkr.ecr.ap-northeast-2.amazonaws.com/taxi-og-generator:latest}
ports:
- "${OG_PORT:?err}:80"
depends_on:
- taxi-back
networks:
- backend
environment:
- API_ROOM_INFO=http://taxi-back/rooms/publicInfo?id={}
- FRONT_URL=${FRONT_URL:-https://taxi.sparcs.org}
labels:
- "com.centurylinklabs.watchtower.scope=taxi"
- 'com.centurylinklabs.watchtower.lifecycle.pre-update=curl -X POST -H ''Content-type: application/json'' --data ''{"text":"[PROD] 업데이트를 위해 taxi-og-generator 서비스를 종료시켰습니다."}'' ${SLACK_WATCHTOWER_WEBHOOK}'
- 'com.centurylinklabs.watchtower.lifecycle.post-update=curl -X POST -H ''Content-type: application/json'' --data ''{"text":"[PROD] 업데이트 후 taxi-og-generator 서비스를 재시작하였습니다."}'' ${SLACK_WATCHTOWER_WEBHOOK}'
taxi-proxy:
container_name: taxi-proxy
restart: always
image: nginx:1.24.0
ports:
- "${PROXY_PORT:?err}:80"
networks:
- proxy
depends_on:
- taxi-front
- taxi-back
volumes:
- ./taxi-proxy/conf.d:/etc/nginx/conf.d:ro
taxi-mongo:
container_name: taxi-mongo
restart: always
image: mongo:4.4
networks:
- backend
volumes:
- ./taxi-mongo/mongodb.conf:/etc/mongodb.conf
- taxi-mongo-logs:/var/log/mongodb/mongod.log:rw
- taxi-mongo-data:/data/db:rw
taxi-redis:
container_name: taxi-redis
restart: always
image: redis:7.0.4-alpine
networks:
- backend
volumes:
- taxi-redis-data:/data:rw
taxi-scheduler:
container_name: taxi-scheduler
restart: always
build: taxi-scheduler
networks:
- backend
environment:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:?err}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:?err}
- BUCKET=${AWS_S3_DUMP_BUCKET_NAME:?err}
- BACKUP_FOLDER=mongodb-dump/
- MONGODB_HOST=taxi-mongo:27017
- DB_STR=taxi
volumes:
- taxi-scheduler-logs:/backup_log:rw
taxi-watchtower:
container_name: taxi-watchtower
image: containrrr/watchtower:latest
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./taxi-ecr-helper/config.json:/config.json
- taxi-ecr-helper-executable:/go/bin
environment:
- HOME=/
- TZ=Asia/Seoul
- PATH=$PATH:/go/bin
- AWS_REGION=ap-northeast-2
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:?err}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:?err}
command: --interval 60 --cleanup --enable-lifecycle-hooks --scope taxi
labels: ["com.centurylinklabs.watchtower.scope=taxi"]
# --schedule "0 0 4 * * *" : 새로운 이미지를 확인하는 6-field cron 표현식 지정
# --cleanup : 업데이트 후 오래된 이미지 제거
# --enable-lifecycle-hooks : 컨테이너 업데이트 시 스크립트 실행 활성화
# taxi-front taxi-back : 업데이트 할 container 지정
volumes:
taxi-mongo-logs:
external: true
taxi-mongo-data:
external: true
taxi-redis-data:
external: true
taxi-back-logs:
external: true
taxi-scheduler-logs:
external: true
taxi-ecr-helper-executable:
external: true
networks:
proxy:
backend: