-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-stack.yml
120 lines (113 loc) · 2.27 KB
/
docker-stack.yml
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
version: "3.8"
services:
node:
image: newsblog:dev
build:
context: .
dockerfile: Dockerfile.dev
user: node
working_dir: /usr/src/app
volumes:
- .:/usr/src/app
- node_modules:/usr/src/app/node_modules
environment:
- NODE_ENV=production
- CHOKIDAR_USEPOLLING=true
command: npm start
deploy:
mode: replicated
replicas: 8
restart_policy:
condition: on-failure
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- private
depends_on:
- mysql
- redis
mysql:
image: mysql:8.4
environment:
MYSQL_ROOT_PASSWORD: $password
MYSQL_DATABASE: news_blog
MYSQL_USER: news_blog
MYSQL_PASSWORD: $password
volumes:
- mysql_data:/var/lib/mysql
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.role == manager
networks:
- private
redis:
image: redis:latest
volumes:
- redis_data:/data
deploy:
mode: replicated
replicas: 1
networks:
- private
phpmyadmin:
image: phpmyadmin:latest
environment:
UPLOAD_LIMIT: 64M
PMA_HOST: mysql
PMA_PORT: 3306
ports:
- published: 8101
target: 80
mode: host
networks:
- public
- private
deploy:
mode: replicated
replicas: 1
depends_on:
- mysql
nginx:
image: nginx:latest
volumes:
- ../frontend/dist:/usr/share/nginx/html/news:ro
- ../admin/dist:/usr/share/nginx/html/admin:ro
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./ssl/main:/etc/nginx/ssl/news:ro
- ./ssl/admin:/etc/nginx/ssl/admin:ro
- ./ssl/api:/etc/nginx/ssl/api:ro
ports:
- published: 80
target: 80
mode: host
- published: 443
target: 443
mode: host
networks:
- public
- private
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
depends_on:
- node
networks:
public:
driver: overlay
attachable: true
private:
driver: overlay
attachable: true
internal: false
volumes:
mysql_data:
redis_data:
node_modules: