-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
122 lines (116 loc) · 2.79 KB
/
docker-compose.yml
File metadata and controls
122 lines (116 loc) · 2.79 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 proxy server
nginx:
image: nginx:1.28.0
container_name: proxy-server
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./certbot/www:/var/www/certbot
- ./certbot/conf:/etc/letsencrypt
depends_on:
app-server:
condition: service_healthy
certbot:
condition: service_started
command: ["nginx", "-g", "daemon off;"]
networks:
- public-net
# Certbot
certbot:
image: certbot/certbot:v1.7.0
container_name: certbot
volumes:
- ./certbot/www:/var/www/certbot
- ./certbot/conf:/etc/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
entrypoint: /bin/sh -c "\
while true; do \
certbot renew --webroot -w /var/www/certbot --quiet && \
docker exec proxy-server nginx -s reload; \
sleep 12h; \
done"
networks:
- public-net
# Application server
app:
image: ${DOCKER_IMAGE_PATH}:latest
env_file:
- .env
container_name: app-server
build:
context: .
dockerfile: Dockerfile
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080/actuator/health" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
depends_on:
redis:
condition: service_healthy
elastic-search:
condition: service_healthy
volumes:
- ./logs:/logs
networks:
- internal-net
expose:
- "8080"
# Redis DB
redis-db:
image: redis:7.4.2-alpine
container_name: redis-db
command: ["redis-server", "--appendonly", "yes"]
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 3s
retries: 5
start_period: 5s
volumes:
- ./redis-data:/data
networks:
- internal-net
expose:
- "6379"
# Elasticsearch
elastic-search:
image: elasticsearch:7.17.28
container_name: elastic-search
environment:
- discovery.type=single-node
- xpack.security.enabled=false
command: >
bash -c "
if [ ! -d '/usr/share/elasticsearch/plugins/analysis-nori' ]; then
elasticsearch-plugin install analysis-nori --batch;
fi &&
exec /usr/local/bin/docker-entrypoint.sh eswrapper
"
healthcheck:
test: [ "CMD-SHELL", "curl -s http://localhost:9200/_cluster/health || exit 1" ]
interval: 10s
retries: 10
timeout: 5s
start_period: 20s
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./es-data:/usr/share/elasticsearch/data
- ./es-plugins:/usr/share/elasticsearch/plugins
networks:
- internal-net
expose:
- "9200"
networks:
public-net:
driver: bridge
internal-net:
internal: true