-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
81 lines (77 loc) · 1.49 KB
/
docker-compose.yml
File metadata and controls
81 lines (77 loc) · 1.49 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.8'
services:
# MySQL
mysql:
image: mysql:8.0
container_name: spms-mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: spms
MYSQL_USER: spms
MYSQL_PASSWORD: spms
ports:
- "3307:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./mysql/init:/docker-entrypoint-initdb.d
command:
networks:
- spms-network
# Redis
redis:
image: redis:7-alpine
container_name: spms-redis
restart: always
ports:
- "6380:6379"
# 无需密码
command: redis-server --requirepass ""
volumes:
- redis_data:/data
networks:
- spms-network
# Server
spms-server:
build:
context: ./SPMS-Server
dockerfile: Dockerfile
args:
- MAVEN_OPTS=-Dmaven.repo.local=/root/.m2/repository
container_name: spms-server
restart: always
ports:
- "8081:8080"
depends_on:
- mysql
- redis
volumes:
- server_storage:/home/
networks:
- spms-network
# Web
spms-web:
build:
context: ./SPMS-Web
dockerfile: Dockerfile
args:
- NODE_OPTIONS=--max-old-space-size=4096
container_name: spms-web
restart: always
ports:
- "81:80"
depends_on:
- spms-server
volumes:
- server_storage:/home/
networks:
- spms-network
# Volumes
volumes:
mysql_data:
redis_data:
server_storage:
# Virtual Networks
networks:
spms-network:
driver: bridge