Created
May 22, 2023 09:40
-
-
Save erikvullings/c8219a16be6577bd6bed7eb2280094d3 to your computer and use it in GitHub Desktop.
Traefik reverse proxy settings in Docker (swarm), including strip path prefix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
version: "3.3" | |
networks: | |
icem-net: | |
driver: overlay | |
attachable: true | |
services: | |
reverse-proxy: | |
image: traefik:v2.4 | |
command: | |
- "--providers.docker.swarmMode=true" | |
- "--providers.docker.exposedbydefault=false" | |
- "--entrypoints.web.address=:80" | |
- "--api.insecure=true" | |
networks: | |
- icem-net | |
ports: | |
- 3080:80 | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
deploy: | |
placement: | |
constraints: [node.role == manager] | |
t2v: | |
image: semitechnologies/transformers-inference:sentence-transformers-paraphrase-multilingual-mpnet-base-v2 | |
networks: | |
- icem-net | |
environment: | |
ENABLE_CUDA: "0" | |
deploy: | |
mode: replicated | |
replicas: 3 | |
labels: | |
- traefik.enable=true | |
- traefik.http.services.t2v.loadbalancer.server.port=8080 | |
- traefik.http.routers.t2v.rule=Host(`${HOST}`) && PathPrefix(`/t2v`) | |
- traefik.http.routers.t2v.middlewares=t2v-stripprefix | |
- traefik.http.middlewares.t2v-stripprefix.stripprefix.prefixes=/t2v | |
placement: | |
constraints: [node.role == worker] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment