Created
May 5, 2024 14:32
-
-
Save antonioanerao/5082d4cf057d11c2bb992b8600ae82c0 to your computer and use it in GitHub Desktop.
Traefik + Portainer for localhost development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
traefik: | |
image: "traefik" | |
container_name: "traefik" | |
restart: always | |
command: | |
- "--log.level=DEBUG" | |
- "--api.insecure=true" | |
- "--providers.docker=true" | |
- "--providers.docker.exposedbydefault=false" | |
- "--entrypoints.web.address=:80" | |
ports: | |
- "80:80" | |
volumes: | |
- "/var/run/docker.sock:/var/run/docker.sock:ro" | |
networks: | |
- proxy | |
portainer: | |
image: portainer/portainer-ce | |
container_name: portainer | |
restart: unless-stopped | |
security_opt: | |
- no-new-privileges:true | |
networks: | |
- proxy | |
ports: | |
- 8000:8000 | |
volumes: | |
- /etc/localtime:/etc/localtime:ro | |
- /var/run/docker.sock:/var/run/docker.sock:ro | |
- ./portainer-data:/data | |
labels: | |
- "traefik.enable=true" | |
- "traefik.docker.network=proxy" | |
- "traefik.http.routers.portainer.rule=Host(`portainer.docker.localhost`)" | |
- "traefik.http.routers.portainer.entrypoints=web" | |
- "traefik.http.services.portainer.loadbalancer.server.port=9000" | |
networks: | |
proxy: | |
external: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment