homelab/archive/2022.bxl-nas/system.docker-compose.yaml

62 lines
2.1 KiB
YAML

version: "3.7"
services:
traefik:
container_name: traefik
image: traefik:v2.9
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=external"
- "--entrypoints.internal.address=:80"
- "--entrypoints.internalsecure.address=:443"
- "--entrypoints.internal.http.redirections.entryPoint.to=internalsecure"
- "--entrypoints.internal.http.redirections.entryPoint.scheme=https"
- "--entrypoints.internal.http.redirections.entryPoint.permanent=true"
- "--certificatesresolvers.http.acme.httpchallenge=true"
- "--certificatesresolvers.http.acme.httpchallenge.entrypoint=external"
- "--certificatesresolvers.http.acme.email=acme@bhasher.com"
- "--certificatesresolvers.http.acme.storage=acme.json"
- "--entrypoints.external.address=:81"
- "--entrypoints.externalsecure.address=:444"
- "--entrypoints.external.http.redirections.entryPoint.to=externalsecure"
- "--entrypoints.external.http.redirections.entryPoint.scheme=https"
- "--entrypoints.external.http.redirections.entryPoint.permanent=true"
environment:
- TZ=Europe/Paris
restart: always
ports:
- "80:80"
- "443:443"
- "81:81"
- "444:444"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- type: bind
source: /mnt/Main/containers/traefik/acme.json
target: /acme.json
networks:
- external
portainerce:
container_name: portainerce
image: portainer/portainer-ce:latest
restart: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.routers.portainer.rule=Host(`portainer.nas.bhasher.com`)"
- "traefik.http.routers.portainer.entrypoints=externalsecure,internalsecure"
- "traefik.http.services.portainer.loadbalancer.server.port=9000"
- "traefik.http.routers.portainer.tls=true"
- "traefik.http.routers.portainer.tls.certresolver=http"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /mnt/Main/containers/portainer:/data
networks:
- external
networks:
external:
name: external