-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
45 lines (45 loc) · 1.19 KB
/
Copy pathdocker-compose.yml
File metadata and controls
45 lines (45 loc) · 1.19 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
version: "3"
services:
# service name 不能有大写字母, 否则不能作为其他服务访问本服务的 URL 地址(提示超时)
web:
# replace username/repo:tag with your name and image details
image: alexgzhou/friendlyhello:latest
deploy:
replicas: 5
resources:
limits:
cpus: "0.1"
memory: 50M
restart_policy:
condition: on-failure
ports:
- "80:80"
networks:
- webnet
# service name 不能有大写字母, 否则不能作为其他服务访问本服务的 URL 地址(提示超时)
visualizer:
image: dockersamples/visualizer:stable
ports:
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
placement:
constraints: [node.role == manager]
networks:
- webnet
# service name 不能有大写字母, 否则不能作为其他服务访问本服务的 URL 地址(提示超时)
redis:
image: redis
ports:
- "6379:6379"
volumes:
- "/home/docker/data:/data"
deploy:
placement:
constraints: [node.role == manager]
command: redis-server --appendonly yes
networks:
- webnet
networks:
webnet: