forked from MJSEC-MJU/MSG_CTF_BACK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
122 lines (114 loc) · 3.13 KB
/
docker-compose.yml
File metadata and controls
122 lines (114 loc) · 3.13 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
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
version: "3.8"
services:
redis:
image: redis:7.0
container_name: ctf-redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
networks:
- ctf-network
db:
image: mysql:8.0
container_name: ctf-mysql
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
networks:
- ctf-network
backend:
image: ${DOCKER_HUB_USERNAME}/backend:latest
container_name: ctf-backend
depends_on:
db:
condition: service_healthy
ports:
- "8080:8080"
environment:
SPRING_PROFILES_ACTIVE: local
DB_HOST: db
DB_PORT: ${DB_PORT}
DB_NAME: ${DB_NAME}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
SPRING_SECURITY_USER_NAME: ${SPRING_SECURITY_USER_NAME}
SPRING_SECURITY_USER_PASSWORD: ${SPRING_SECURITY_USER_PASSWORD}
JWT_SECRET: ${JWT_SECRET}
SPRING_REDIS_HOST: redis
SPRING_REDIS_PORT: 6379
GMAIL_USERNAME: ${GMAIL_USERNAME}
GMAIL_APP_PASSWORD: ${GMAIL_APP_PASSWORD}
API_KEY: ${API_KEY}
API_URL: ${API_URL}
BUCKET: ${BUCKET}
LOCATION: file:/secrets/gcp_service_account.json
PROJECT_ID: ${PROJECT_ID}
GCP_JSON_FILE: ${GCP_JSON_FILE}
# 컨테이너 내부에서 서비스 계정 키 파일 경로를 지정합니다.
GOOGLE_APPLICATION_CREDENTIALS: /secrets/gcp_service_account.json
# 서버의 /home/ubuntu/src 에 업로드된 키 파일을 컨테이너로 마운트합니다.
volumes:
- /home/ubuntu/src/${GCP_JSON_FILE}:/secrets/gcp_service_account.json:ro
networks:
- ctf-network
nginx:
image: ${DOCKER_HUB_USERNAME}/nginx:latest
container_name: ctf-nginx
depends_on:
- backend
ports:
- "443:443"
volumes:
- /home/ubuntu/app/nginx/conf.d:/etc/nginx/conf.d:ro
- /home/ubuntu/app/nginx/ssl:/etc/letsencrypt/live/msg.mjsec.kr:ro
networks:
- ctf-network
frontend:
image: ${DOCKER_HUB_USERNAME}/frontend:latest
container_name: ctf-frontend
expose:
- "80"
networks:
- ctf-network
test:
image: gradle:8.1.1-jdk17
container_name: ctf-test
working_dir: /app
volumes:
- ./Back:/app
- gradle_cache:/home/gradle/.gradle
environment:
SPRING_PROFILES_ACTIVE: local
DB_HOST: db
DB_PORT: ${DB_PORT}
DB_NAME: ${DB_NAME}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
SPRING_SECURITY_USER_NAME: ${SPRING_SECURITY_USER_NAME}
SPRING_SECURITY_USER_PASSWORD: ${SPRING_SECURITY_USER_PASSWORD}
JWT_SECRET: ${JWT_SECRET}
depends_on:
db:
condition: service_healthy
entrypoint: ["sh", "-c"]
command: ["./gradlew test --stacktrace"]
networks:
- ctf-network
volumes:
gradle_cache:
networks:
ctf-network:
driver: bridge