semaphore-playbooks/debian12-docker/templates/traefic-docker-compose.yml

51 lines
1.5 KiB
YAML
Raw Normal View History

2023-07-21 01:18:35 +00:00
version: "3.3"
services:
traefik:
image: "traefik:v2.10"
container_name: "traefik"
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
2023-07-21 01:33:35 +00:00
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
2023-07-21 01:18:35 +00:00
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.httpchallenge=true"
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
#- "--certificatesresolvers.myresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
- "--certificatesresolvers.myresolver.acme.email=admin@keks.cloud"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
2023-07-21 01:36:56 +00:00
# - "8080:8080"
2023-07-21 01:18:35 +00:00
volumes:
- "./letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
2023-07-21 01:22:20 +00:00
restart: always
2023-07-21 02:19:10 +00:00
networks:
- proxy
2023-07-21 01:18:35 +00:00
2024-08-12 11:17:44 +00:00
{% if whoami == 1 %}
2024-08-12 11:10:09 +00:00
whoami:
image: "traefik/whoami"
container_name: "simple-service"
restart: always
labels:
- "traefik.enable=true"
- "traefik.http.routers.whoami.rule=Host(`{{ inventory_hostname }}`)"
- "traefik.http.routers.whoami.entrypoints=websecure"
- "traefik.http.routers.whoami.tls.certresolver=myresolver"
networks:
- proxy
2024-08-12 11:17:44 +00:00
{% endif %}
2024-08-12 11:10:09 +00:00
2023-07-21 02:19:10 +00:00
networks:
proxy:
name: proxy