selfhosting/portainer/docker-compose.portainer.yml
2021-11-01 19:10:42 +01:00

28 lines
1 KiB
YAML
Executable file

version: '3'
services:
portainer:
container_name: portainer
image: portainer/portainer-ce
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
networks:
- srv
restart: unless-stopped
expose:
- 9000
labels:
- traefik.enable=true
- traefik.http.routers.portainer.rule=Host(`${HOST_WWW}.${DOMAIN}`) && PathPrefix(`${PATH_PORTAINER}`)
- traefik.http.routers.portainer.entrypoints=websecure
- traefik.http.routers.portainer.tls=true
- traefik.http.services.portainer.loadbalancer.server.port=9000
- traefik.http.routers.portainer.middlewares=portainerRedir,portainerPStrip
- traefik.http.middlewares.portainerPStrip.stripprefix.prefixes=${PATH_PORTAINER}
- traefik.http.middlewares.portainerRedir.redirectregex.regex=^(.*)${PATH_PORTAINER}$$
- traefik.http.middlewares.portainerRedir.redirectregex.replacement=$${1}${PATH_PORTAINER}/
volumes:
portainer_data: