-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
82 lines (77 loc) · 1.93 KB
/
Copy pathdocker-compose.yml
File metadata and controls
82 lines (77 loc) · 1.93 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
version: "3.8"
services:
mysql:
image: mysql:8.0.37
container_name: unistock-mysql
restart: unless-stopped
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --default-time-zone=+08:00
env_file:
- ./env/mysql.env
volumes:
- ../../data/mysql:/var/lib/mysql
- ./mysql/init:/docker-entrypoint-initdb.d:ro
networks:
- unistock_net
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p$${MYSQL_ROOT_PASSWORD} --silent"]
interval: 10s
timeout: 5s
retries: 10
redis:
image: redis:7.2-alpine
container_name: unistock-redis
restart: unless-stopped
env_file:
- ./env/app.env
command:
- sh
- -c
- redis-server --appendonly yes --requirepass "$${REDIS_PASSWORD:-ChangeMeRedisPassword}"
volumes:
- ../../data/redis:/data
networks:
- unistock_net
healthcheck:
test: ["CMD-SHELL", "redis-cli -a \"$${REDIS_PASSWORD:-ChangeMeRedisPassword}\" ping | grep -q PONG"]
interval: 10s
timeout: 5s
retries: 10
backend:
build:
context: .
dockerfile: Dockerfile.backend.runtime
image: unistock/backend-runtime:latest
container_name: unistock-backend
restart: unless-stopped
env_file:
- ./env/app.env
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
networks:
- unistock_net
nginx:
image: nginx:1.27-alpine
container_name: unistock-nginx
restart: unless-stopped
environment:
- TZ=Asia/Shanghai
depends_on:
- backend
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/conf.d/active.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
- ../../logs/nginx:/var/log/nginx
networks:
- unistock_net
networks:
unistock_net:
driver: bridge