@@ -3,17 +3,12 @@ version: '3.8'
33services :
44 traefik :
55 image : docker.io/library/traefik:v3.0
6- command :
7- - " --api.insecure=true"
8- - " --providers.docker=true"
9- - " --providers.docker.exposedbydefault=false"
10- - " --entrypoints.web.address=:8000"
116 ports :
127 - " 8000:8000"
138 - " 8090:8080" # Traefik dashboard
149 volumes :
15- - " /var/run/docker.sock:/var/run/docker.sock :ro"
16- privileged : true
10+ - ./traefik.yml:/etc/traefik/traefik.yml :ro
11+ - ./traefik-routes.yml:/etc/traefik/conf/routes.yml:ro
1712
1813 redis :
1914 image : redis:7-alpine
@@ -28,7 +23,27 @@ services:
2823 timeout : 3s
2924 retries : 5
3025
31- streaming_api :
26+ streaming_api-1 :
27+ build : .
28+ environment :
29+ - REDIS_URL=redis://redis:6379/0
30+ depends_on :
31+ redis :
32+ condition : service_healthy
33+ volumes :
34+ - ./server.py:/app/server.py:ro
35+
36+ streaming_api-2 :
37+ build : .
38+ environment :
39+ - REDIS_URL=redis://redis:6379/0
40+ depends_on :
41+ redis :
42+ condition : service_healthy
43+ volumes :
44+ - ./server.py:/app/server.py:ro
45+
46+ streaming_api-3 :
3247 build : .
3348 environment :
3449 - REDIS_URL=redis://redis:6379/0
@@ -37,10 +52,3 @@ services:
3752 condition : service_healthy
3853 volumes :
3954 - ./server.py:/app/server.py:ro
40- labels :
41- - " traefik.enable=true"
42- - " traefik.http.routers.streaming_api.rule=Host(`localhost`)"
43- - " traefik.http.routers.streaming_api.entrypoints=web"
44- - " traefik.http.services.streaming_api.loadbalancer.server.port=8000"
45- deploy :
46- replicas : 3
0 commit comments