Traefik docker-compose Solution #2

Closed
opened 2022-10-28 13:49:20 +00:00 by luke-else · 5 comments
Owner

Traefik container has...
command:
## General Settings ##
- --api.insecure=true
- --api.dashboard=true
- --api.debug=true

  ## Log Settings ##      
  - --log.level=DEBUG # <== Setting the level of the logs from traefik

  ## Provider Settings ##
  - --providers.docker=true
  - --providers.docker.exposedbydefault=false
  - --providers.file.filename=/dynamic.yaml

  ## Entrypoints Settings ##
  - --entrypoints.http.address=:80
  - --entrypoints.https.address=:443

  ## Certificate Settings ##
  - --certificatesresolvers.mytlschallenge.acme.tlschallenge=true
  - --certificatesresolvers.mytlschallenge.acme.email=contact@luke-else.co.uk
  - --certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json

volumes:
- ./letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
- ./dynamic.yaml:/dynamic.yaml
labels:
## Exposing API Dashboard Service ##
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(monitor.example.com)"
- "traefik.http.routers.api.service=api@internal"

Each child container has

labels:
## Expose ... Through Trefik ##
- "traefik.enable=true" # <== Enable traefik to proxy this container
- "traefik.http.routers.containername.rule=Host(example.com)"
- "traefik.http.routers.containername.entrypoints=http"
- "traefik.http.routers.containername.middlewares=redirect@file"

  - "traefik.http.routers.containername-secured.rule=Host(`example.com`)"
  - "traefik.http.routers.containername-secured.entrypoints=https"
  - "traefik.http.routers.containername-secured.tls.certresolver=mytlschallenge"
Traefik container has... command: ## General Settings ## - --api.insecure=true - --api.dashboard=true - --api.debug=true ## Log Settings ## - --log.level=DEBUG # <== Setting the level of the logs from traefik ## Provider Settings ## - --providers.docker=true - --providers.docker.exposedbydefault=false - --providers.file.filename=/dynamic.yaml ## Entrypoints Settings ## - --entrypoints.http.address=:80 - --entrypoints.https.address=:443 ## Certificate Settings ## - --certificatesresolvers.mytlschallenge.acme.tlschallenge=true - --certificatesresolvers.mytlschallenge.acme.email=contact@luke-else.co.uk - --certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json volumes: - ./letsencrypt:/letsencrypt - /var/run/docker.sock:/var/run/docker.sock - ./dynamic.yaml:/dynamic.yaml labels: ## Exposing API Dashboard Service ## - "traefik.enable=true" - "traefik.http.routers.api.rule=Host(`monitor.example.com`)" - "traefik.http.routers.api.service=api@internal" Each child container has labels: ## Expose ... Through Trefik ## - "traefik.enable=true" # <== Enable traefik to proxy this container - "traefik.http.routers.containername.rule=Host(`example.com`)" - "traefik.http.routers.containername.entrypoints=http" - "traefik.http.routers.containername.middlewares=redirect@file" - "traefik.http.routers.containername-secured.rule=Host(`example.com`)" - "traefik.http.routers.containername-secured.entrypoints=https" - "traefik.http.routers.containername-secured.tls.certresolver=mytlschallenge"
Author
Owner

All relevant containers now depend on Trafik as a container

They also are all on their own separate network... unless they require to share

All relevant containers now depend on Trafik as a container They also are all on their own separate network... unless they require to share
Author
Owner

Containers unable to see Traefik, depends-on can be removed as script now spins containers in the correct order.

Containers unable to see Traefik, depends-on can be removed as script now spins containers in the correct order.
Author
Owner

88b4133cf7

Removed Dependencies

https://git.luke-else.co.uk/luke-else/server/commit/88b4133cf71a91d46c7007235a0f3f797de7cf00 Removed Dependencies
luke-else added reference master 2023-08-14 20:22:12 +00:00
Author
Owner

Merged with commit c83cf90b79
Merge Request TraefikIntegration #5

Merged with commit c83cf90b79 Merge Request TraefikIntegration #5
Author
Owner

Complete! :)

Complete! :)
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: luke-else/server#2
No description provided.