-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
153 lines (144 loc) · 4.27 KB
/
docker-compose.yml
File metadata and controls
153 lines (144 loc) · 4.27 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
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
version: '3'
services:
springboot:
image: openjdk:17-jdk-slim
build: .
container_name: runmate-backend
volumes:
- ./app.jar:/app/app.jar # 호스트의 app.jar를 컨테이너에 마운트
- runmate-logs:/app/logs # 로그 데이터를 위한 볼륨 추가
- runmate-gpx:/app/gpx # GPX 데이터를 위한 볼륨 추가
- runmate-uploads:/app/uploads # 업로드 파일을 위한 볼륨 추가
- /etc/localtime:/etc/localtime:ro # 호스트의 시간대 설정을 컨테이너에 적용
- /etc/timezone:/etc/timezone:ro
restart: always
ports:
- '8080:8080'
command: ['java', '-jar', '/app/app.jar']
env_file:
- .env
environment:
- APP_BASE_URL=https://k12d107.p.ssafy.io # 기본 URL 설정
- JAVA_TOOL_OPTIONS=-Duser.timezone=Asia/Seoul # JVM 시간대 설정
- TZ=Asia/Seoul # 컨테이너 레벨 TZ 환경변수도 함께 지정
depends_on:
- postgres
- redis
networks:
- project-net
postgres:
image: postgres:15
container_name: postgres
restart: always
env_file:
- .env
environment:
# 기본 슈퍼유저로 initdb 수행
# POSTGRES_USER, POSTGRES_DB 는 지정하지 않습니다.
- POSTGRES_PASSWORD=${DB_PASSWORD}
- TZ=Asia/Seoul
volumes:
# initdb 후 init-user-db.sh 를 실행
- ./postgres-init:/docker-entrypoint-initdb.d
- postgres-data:/var/lib/postgresql/data # 데이터베이스 데이터를 위한 볼륨 추가
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
networks:
- project-net
ports:
- '5432:5432'
redis:
image: redis:7
container_name: redis
restart: always
ports:
- '6379:6379'
volumes:
- redis-data:/data # Redis 데이터를 위한 볼륨 추가
command: redis-server --appendonly yes # AOF 지속성 활성화
networks:
- project-net
nodejs:
build: ./backend/nodejs
container_name: runmate-realtime
restart: always
ports:
- '3000:3000'
volumes:
- runmate-logs:/app/logs
env_file:
- .env
environment:
- PORT=3000
- CORS_ORIGIN=*
networks:
- project-net
nginx:
image: nginx:stable
container_name: nginx
restart: always
ports:
- '80:80'
- '443:443'
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- certbot-etc:/etc/letsencrypt
- web-root:/var/www/html
- nginx-logs:/var/log/nginx # Nginx 로그를 위한 볼륨 추가
- runmate-uploads:/app/uploads:ro # 업로드 파일을 읽기 전용으로 마운트
depends_on:
- springboot
networks:
- project-net
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- web-root:/var/www/html
command: certonly --webroot --webroot-path=/var/www/html --email kimh0414@gmail.com --agree-tos --no-eff-email -d k12d107.p.ssafy.io
depends_on:
- nginx
marathon-crawler:
build:
context: ./backend/marathon-crawler
dockerfile: Dockerfile
container_name: marathon-crawler
restart: always
volumes:
- ./backend/marathon-crawler/logs:/app/logs
- ./backend/marathon-crawler/.env:/app/.env
- runmate-logs:/app/logs/shared # 공유 로그 볼륨 추가
env_file:
- .env # 공통 환경 변수 파일 사용
environment:
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- DB_HOST=postgres
- DB_PORT=5432
- DB_NAME=${DB_NAME}
- CRAWL_HOUR=1
- CRAWL_MINUTE=0
- RUN_ON_START=false
- LOG_LEVEL=INFO
depends_on:
- postgres
networks:
- project-net # runmate-network에서 project-net으로 변경
networks:
project-net:
driver: bridge
runmate-network:
driver: bridge
volumes:
certbot-etc:
certbot-var:
web-root:
postgres-data: # PostgreSQL 데이터 볼륨 정의
redis-data: # Redis 데이터 볼륨 정의
runmate-logs: # 애플리케이션 로그 볼륨 정의
nginx-logs: # Nginx 로그 볼륨 정의
runmate-gpx: # GPX 데이터 볼륨 정의
runmate-uploads: # 업로드 파일 볼륨 정의