-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
122 lines (116 loc) · 2.63 KB
/
docker-compose.yml
File metadata and controls
122 lines (116 loc) · 2.63 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:
nginx:
build: ./nginx
container_name: waggle-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./.htpasswd:/etc/nginx/.htpasswd:ro
- /etc/letsencrypt:/etc/letsencrypt:ro
- nginx-logs:/var/log/nginx
depends_on:
- app
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
restart: unless-stopped
app:
build: .
container_name: waggle-app
expose:
- "8080"
environment:
# Spring Profile
SPRING_PROFILES_ACTIVE: prod
# Database (Docker 내부 연결)
DB_HOST: database
DB_PORT: 3306
DB_NAME: ${DB_NAME}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
# Redis (Docker 내부 연결)
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
depends_on:
database:
condition: service_healthy
redis:
condition: service_started
env_file:
- .env
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
stop_grace_period: 40s
restart: unless-stopped
database:
image: mysql:8.0
container_name: waggle-db
command: --ngram-token-size=2
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
TZ: Asia/Seoul
ports:
- "3306:3306"
volumes:
- db-data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: waggle-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
restart: unless-stopped
fail2ban:
image: crazymax/fail2ban:latest
container_name: waggle-fail2ban
network_mode: host
cap_add:
- NET_ADMIN
- NET_RAW
volumes:
- ./fail2ban/jail.local:/etc/fail2ban/jail.local:ro
- ./fail2ban/filter.d:/etc/fail2ban/filter.d:ro
- nginx-logs:/var/log/nginx:ro
- fail2ban-data:/var/lib/fail2ban
depends_on:
- nginx
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
restart: unless-stopped
volumes:
db-data:
redis-data:
nginx-logs:
fail2ban-data: