-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (70 loc) · 1.78 KB
/
docker-compose.yml
File metadata and controls
75 lines (70 loc) · 1.78 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
services:
cache:
image: redis:alpine
container_name: todo-redis-cache
networks:
- todo-network
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 3s
api:
build:
context: src/server
dockerfile: Dockerfile
image: todo-api:latest
container_name: todo-api
ports:
- "8070:8080"
networks:
- todo-network
environment:
- ASPNETCORE_ENVIRONMENT=Production
depends_on:
- cache
command:
- "sh -c dotnet Todo.Api.dll ef database update && dotnet Todo.Api.dll"
healthcheck:
test: ["CMD", "curl", "-f", "http://todo-api:8080/health"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 10s
client:
build: src/client
image: todo-client:latest
container_name: todo-client
networks:
- todo-network
environment:
- VITE_SERVER_URL=http://todo-api:8070/api
depends_on:
- api
volumes:
- dist:/Todo
reverse-proxy:
image: nginx:alpine
container_name: todo-reverse-proxy
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- todo-network
depends_on:
- cache
- api
- client
volumes:
dist:
name: dist
networks:
todo-network:
driver: bridge
name: todo-network