Skip to content

Commit

Permalink
working for http
Browse files Browse the repository at this point in the history
  • Loading branch information
leej3 committed Aug 6, 2024
1 parent 9b009a1 commit 07fda7a
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions web_api/docker-compose.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ services:
working_dir: /app/app
labels:
- traefik.enable=true
- traefik.http.services.osm_web_api.loadbalancer.server.port=80
- traefik.http.routers.osm_web_api-http.rule=Host(`osm.pythonaisolutions.com`)
- traefik.http.routers.osm_web_api-http.entrypoints=http
- traefik.http.routers.osm_web_api.rule=Host(`osm.pythonaisolutions.com`)
- traefik.http.routers.osm_web_api.entrypoints=http
- traefik.http.services.osm_web_api-http.loadbalancer.server.port=80
- traefik.docker.network=traefik-public
# https
- traefik.http.routers.osm_web_api-https.rule=Host(`osm.pythonaisolutions.com`)
Expand All @@ -22,6 +22,8 @@ services:
- traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
# apply the redirect middleware to the http router
- traefik.http.routers.osm_web_api-http.middlewares=https-redirect
networks:
- traefik-public

traefik:
image: traefik
Expand All @@ -33,13 +35,15 @@ services:
- --providers.docker.exposedbydefault=false
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
- --certificatesresolvers.le.acme.email={{ cert_email }}
- "--certificatesresolvers.le.acme.email={{ cert_email }}"
- --certificatesresolvers.le.acme.storage=/certificates/acme.json
- --certificatesresolvers.le.acme.tlschallenge=true
- --log
- --accesslog
- --api.insecure=true
ports:
- 80:80
- 8080:8080
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
Expand All @@ -48,6 +52,18 @@ services:
- traefik-public


whoami:
image: "traefik/whoami"
container_name: "simple-service"
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`osm.pythonaisolutions.com`)"
- "traefik.http.routers.whoami.entrypoints=https"
- "traefik.http.routers.whoami.tls.certresolver=le"
networks:
- traefik-public


volumes:
traefik-public-certificates:

Expand Down

0 comments on commit 07fda7a

Please sign in to comment.