|
|
@ -21,9 +21,36 @@ services: |
|
|
|
delay: 10s |
|
|
|
max_attempts: 10 |
|
|
|
window: 60s |
|
|
|
replicas: 1 |
|
|
|
placement: |
|
|
|
constraints: |
|
|
|
- node.labels.myapp==true //<6> |
|
|
|
resources: //<8> |
|
|
|
limits: |
|
|
|
cpus: '0.50' |
|
|
|
memory: 500M |
|
|
|
reservations: |
|
|
|
cpus: '0.25' |
|
|
|
memory: 200M |
|
|
|
restart_policy: //<9> |
|
|
|
condition: on-failure |
|
|
|
delay: 5s |
|
|
|
max_attempts: 5 |
|
|
|
window: 120s |
|
|
|
update_config: |
|
|
|
parallelism: 2 |
|
|
|
delay: 10s |
|
|
|
order: stop-first |
|
|
|
environment: |
|
|
|
- MYPASSWORD=${PASSWORD} |
|
|
|
- NODENAME={{.Node.Hostname}} |
|
|
|
- NODEID={{.Node.ID}} |
|
|
|
- SERVICEID={{.Service.ID}} |
|
|
|
- SERVICENAME={{.Service.Name}} |
|
|
|
- TASKID={{.Task.ID}} |
|
|
|
- TASKNAME={{.Task.Name}} |
|
|
|
- TASKREPID={{.Task.Slot}} |
|
|
|
|
|
|
|
|
|
|
|
mybrowser: |
|
|
|
image: nginx:1.17.9-alpine |
|
|
@ -62,6 +89,8 @@ networks: |
|
|
|
<5> Network to Use |
|
|
|
<6> Node Placement |
|
|
|
<7> Start server |
|
|
|
<8> Resources config |
|
|
|
<9> Restart policy |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|