parent
965df035c5
commit
4379db0424
1 changed files with 63 additions and 0 deletions
@ -0,0 +1,63 @@ |
|||||||
|
version: '3' |
||||||
|
|
||||||
|
services: |
||||||
|
traefik: |
||||||
|
image: traefik:v2.2 |
||||||
|
container_name: traefik |
||||||
|
restart: unless-stopped |
||||||
|
security_opt: |
||||||
|
- no-new-privileges:true |
||||||
|
networks: |
||||||
|
- traefik-proxy |
||||||
|
ports: |
||||||
|
- 80:80 |
||||||
|
- 443:443 |
||||||
|
volumes: |
||||||
|
- /etc/localtime:/etc/localtime:ro |
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro |
||||||
|
- ./traefik-data/traefik.yml:/traefik.yml:ro |
||||||
|
- ./traefik-data/acme.json:/acme.json |
||||||
|
labels: |
||||||
|
- "traefik.enable=true" |
||||||
|
- "traefik.http.routers.traefik.entrypoints=http" |
||||||
|
- "traefik.http.routers.traefik.rule=Host(`${TRAEFIK_HOST}`)" |
||||||
|
- "traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIK_USER}:${TRAEFIK_PW}" |
||||||
|
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https" |
||||||
|
- "traefik.http.routers.traefik.middlewares=traefik-https-redirect" |
||||||
|
- "traefik.http.routers.traefik-secure.entrypoints=https" |
||||||
|
- "traefik.http.routers.traefik-secure.rule=Host(`${TRAEFIK_HOST}`)" |
||||||
|
- "traefik.http.routers.traefik-secure.middlewares=traefik-auth" |
||||||
|
- "traefik.http.routers.traefik-secure.tls=true" |
||||||
|
- "traefik.http.routers.traefik-secure.tls.certresolver=http" |
||||||
|
- "traefik.http.routers.traefik-secure.service=api@internal" |
||||||
|
|
||||||
|
portainer: |
||||||
|
image: portainer/portainer:latest |
||||||
|
container_name: portainer |
||||||
|
restart: unless-stopped |
||||||
|
security_opt: |
||||||
|
- no-new-privileges:true |
||||||
|
networks: |
||||||
|
- traefik-proxy |
||||||
|
volumes: |
||||||
|
- /etc/localtime:/etc/localtime:ro |
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro |
||||||
|
- ./portainer-data:/data |
||||||
|
labels: |
||||||
|
- "traefik.enable=true" |
||||||
|
- "traefik.http.routers.portainer.entrypoints=http" |
||||||
|
- "traefik.http.routers.portainer.rule=Host(`${PORTAINER_HOST}`)" |
||||||
|
- "traefik.http.middlewares.portainer-https-redirect.redirectscheme.scheme=https" |
||||||
|
- "traefik.http.routers.portainer.middlewares=portainer-https-redirect" |
||||||
|
- "traefik.http.routers.portainer-secure.entrypoints=https" |
||||||
|
- "traefik.http.routers.portainer-secure.rule=Host(`${PORTAINER_HOST}`)" |
||||||
|
- "traefik.http.routers.portainer-secure.tls=true" |
||||||
|
- "traefik.http.routers.portainer-secure.tls.certresolver=http" |
||||||
|
- "traefik.http.routers.portainer-secure.service=portainer" |
||||||
|
- "traefik.http.services.portainer.loadbalancer.server.port=${PORTAINER_LBPORT}" |
||||||
|
- "traefik.docker.network=traefik-proxy" |
||||||
|
|
||||||
|
networks: |
||||||
|
traefik-proxy: |
||||||
|
external: true |
||||||
|
|
||||||
Loading…
Reference in new issue