refactor: migrate from nginx to traefik labels
This commit is contained in:
parent
11b2c45e36
commit
7e8eaf33f2
1 changed files with 15 additions and 0 deletions
|
|
@ -66,6 +66,7 @@ services:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- mtad-network-gemini
|
- mtad-network-gemini
|
||||||
|
- traefik
|
||||||
volumes:
|
volumes:
|
||||||
- ./app:/app/app:ro
|
- ./app:/app/app:ro
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
|
@ -74,6 +75,12 @@ services:
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.http.routers.mtad-api.rule=Host(`mtd.runfoo.run`) && (PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`) || PathPrefix(`/openapi.json`))"
|
||||||
|
- "traefik.http.routers.mtad-api.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.mtad-api.tls.certresolver=myresolver"
|
||||||
|
- "traefik.http.services.mtad-api.loadbalancer.server.port=8000"
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
|
|
@ -87,10 +94,16 @@ services:
|
||||||
- "3000"
|
- "3000"
|
||||||
networks:
|
networks:
|
||||||
- mtad-network-gemini
|
- mtad-network-gemini
|
||||||
|
- traefik
|
||||||
depends_on:
|
depends_on:
|
||||||
- api
|
- api
|
||||||
environment:
|
environment:
|
||||||
NEXT_PUBLIC_API_BASE_URL: https://mtd.runfoo.run/api/v1
|
NEXT_PUBLIC_API_BASE_URL: https://mtd.runfoo.run/api/v1
|
||||||
|
labels:
|
||||||
|
- "traefik.http.routers.mtad-frontend.rule=Host(`mtd.runfoo.run`)"
|
||||||
|
- "traefik.http.routers.mtad-frontend.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.mtad-frontend.tls.certresolver=myresolver"
|
||||||
|
- "traefik.http.services.mtad-frontend.loadbalancer.server.port=3000"
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
image: nginx:alpine
|
image: nginx:alpine
|
||||||
|
|
@ -118,6 +131,8 @@ services:
|
||||||
networks:
|
networks:
|
||||||
mtad-network-gemini:
|
mtad-network-gemini:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
traefik:
|
||||||
|
external: true
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data_gemini:
|
postgres_data_gemini:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue