-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
77 lines (69 loc) · 2.61 KB
/
docker-compose.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
x-common-networks: &common-networks
networks:
- d-gui-network
x-common-extra-hosts: &extra-hosts
# use host.docker.internal to access the host machine from within the container
extra_hosts:
- "host.docker.internal:host-gateway"
services:
backend:
<<: [*common-networks, *extra-hosts]
build:
context: .
dockerfile: ./Dockerfile
image: d-gui-manager-web
container_name: d-gui-manager-web
entrypoint: /src/docker-entrypoint.sh
environment:
- DOCKER_NETWORK=d-gui-network
volumes:
- ./src:/src # backend source code for hot reloading
- ./supervisord.conf:/etc/supervisor/conf.d/supervisord.conf:rw # supervisord config
- /var/run/docker.sock:/var/run/docker.sock:rw # to access the host docker daemon
labels:
- "traefik.enable=true"
# Define router for /
- "traefik.http.routers.backend-root.rule=Path(`/`)"
- "traefik.http.routers.backend-root.service=backend-service"
# Define router for /login
- "traefik.http.routers.backend-login.rule=PathPrefix(`/login`)"
- "traefik.http.routers.backend-login.service=backend-service"
# Define router for /dashboard
- "traefik.http.routers.backend-dashboard.rule=PathPrefix(`/dashboard`)"
- "traefik.http.routers.backend-dashboard.service=backend-service"
# Define router for /api
- "traefik.http.routers.backend-api.rule=PathPrefix(`/api`)"
- "traefik.http.routers.backend-api.service=backend-service"
# Define router for websocket
- "traefik.http.routers.backend-websocket.rule=PathPrefix(`/ws`)"
- "traefik.http.routers.backend-websocket.service=backend-service"
# Define the service
- "traefik.http.services.backend-service.loadbalancer.server.port=8000"
redis:
<<: [*common-networks]
image: redis:alpine
container_name: d-gui-manager-redis
nvidia-cuda:
# for testing with GPU support
image: nvidia/cuda:11.0.3-base-ubuntu20.04
container_name: d-gui-cuda
entrypoint: ["echo", "CUDA image ready"]
traefik:
<<: [*common-networks]
image: traefik:v3.0
container_name: d-gui-proxy
command:
- --providers.docker
- --providers.docker.exposedByDefault=false
- --entrypoints.web.address=:80
- --api.dashboard=true
- --api.insecure
- --serverstransport.insecureskipverify=true
ports:
- "8000:80" # Backend entrypoint
- "8080:8080" # Traefik Dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
d-gui-network:
external: true