-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-deploy.yml
69 lines (65 loc) · 1.72 KB
/
docker-compose-deploy.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
services:
cache:
image: redis:alpine
container_name: todo-redis-cache
networks:
- todo-network
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 10s
retries: 3
labels:
- "com.centurylinklabs.watchtower.enable=true"
api:
image: only1adwy/todo-api:latest
environment:
- ASPNETCORE_ENVIRONMENT=Production
deploy:
mode: replicated
replicas: 2
update_config:
parallelism: 1
restart_policy:
condition: on-failure
resources:
limits:
cpus: "1"
memory: 1G
reservations:
cpus: "0.25"
memory: 125M
depends_on:
- cache
networks:
- todo-network
command:
- "sh -c dotnet Todo.Api.dll ef database update && dotnet Todo.Api.dll"
labels:
- "com.centurylinklabs.watchtower.enable=true"
nginx:
image: nginx:alpine
container_name: todo-reverse-proxy
ports:
- "8070:8070"
volumes:
- ./conf.d:/etc/nginx/conf.d
- /var/run/docker.sock:/tmp/docker.sock:ro
depends_on:
- cache
- api
networks:
- todo-network
labels:
- "com.centurylinklabs.watchtower.enable=true"
volumes:
redis-data:
name: redis-data
networks:
todo-network:
driver: bridge
name: todo-network