-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (74 loc) · 2.08 KB
/
docker-compose.yml
File metadata and controls
81 lines (74 loc) · 2.08 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
version: "3.4"
services:
mysql:
image: mariadb:10.4.20
container_name: mysql
restart: always
ports:
- "32000:3306"
volumes:
- mysql-data:/var/lib/mysql
- ./mysql/initdb.d/:/docker-entrypoint-initdb.d/
env_file: .env
privileged: true
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
networks:
- internal_network
redis:
image: redis:6.2.4-alpine
container_name: redis
restart: always
volumes:
- redis-data:/data
ports:
- "32001:6379"
networks:
- internal_network
backend:
image: ${REGISTRY}/camfia/backend
container_name: backend
volumes:
- ./log:/log
env_file: .env
environment:
SPRING_PROFILES_ACTIVE: "prod"
SPRING_DATASOURCE_URL: "jdbc:mysql://mysql:3306/${MYSQL_DATABASE}?useUnicode=yes&characterEncoding=UTF-8&serverTimezone=Asia/Seoul&zeroDateTimeBehavior=convertToNull&rewriteBatchedStatements=true"
SPRING_REDIS_HOST: "redis"
server.address: 0.0.0.0
depends_on:
- mysql
- redis
networks:
- internal_network
nginx:
image: ${REGISTRY}/camfia/nginx
container_name: nginx
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/default.conf.template:/etc/nginx/conf.d/default.conf.template:ro
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
env_file: .env
depends_on:
- backend
- certbot
networks:
- internal_network
command: /bin/sh -c "while :; do sleep 6h & wait $${!}; nginx -s reload; done & envsubst '$${APP_DOMAIN}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g \"daemon off;\""
certbot:
container_name: certbot
image: certbot/certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
networks:
- internal_network
networks:
internal_network:
volumes:
mysql-data:
redis-data: