1
0
Fork 0
docker-easy-haproxy/examples/swarm/portainer.yml
Joao Gilberto Magalhaes b9a9bee0b9 Revamp Swarm example documentation and streamline deployment instructions
- Consolidated and simplified Swarm example README to focus on YAML header comments for documentation.
- Removed redundant and extended sections, replacing with concise steps for getting started.
- Standardized YAML headers across `easyhaproxy.yml`, `services.yml`, and `portainer.yml` with a clearer and more readable format.
- Enhanced user guidance for deployment, setup requirements, verification, and cleanup.
2025-12-04 10:07:17 -05:00

67 lines
1.8 KiB
YAML

# ==============================================================================
# EXAMPLE: Portainer Behind EasyHAProxy (Swarm)
# ==============================================================================
#
# WHAT THIS DEMONSTRATES:
# - Running Portainer management UI in Swarm mode
# - Service discovery with EasyHAProxy
# - Using persistent volumes for Portainer data
#
# REQUIREMENTS (run these first):
# ```bash
# # Ensure EasyHAProxy is deployed
# docker stack deploy -c easyhaproxy.yml easyhaproxy
#
# # Add to /etc/hosts (idempotent)
# grep -q "portainer.local" /etc/hosts || echo "127.0.0.1 portainer.local" | sudo tee -a /etc/hosts
# ```
#
# HOW TO START:
# ```bash
# docker stack deploy -c portainer.yml portainer
# ```
#
# HOW TO VERIFY IT'S WORKING:
# ```bash
# # Check service is running
# docker service ls | grep portainer
# # Expected: portainer_portainer with 1/1 replicas
#
# # Access Portainer
# curl http://portainer.local
# # Or open in browser: http://portainer.local
# # First time: Create admin user
# ```
#
# CLEAN UP:
# ```bash
# docker stack rm portainer
# # To also remove data volume:
# # docker volume rm portainer_portainer_data
# ```
#
# ==============================================================================
services:
portainer:
image: portainer/portainer-ce:latest
volumes:
- portainer_data:/data portainer
- /var/run/docker.sock:/var/run/docker.sock
deploy:
replicas: 1
labels:
# easyhaproxy.http.redirect_ssl: true
# easyhaproxy.http.certbot: true
easyhaproxy.http.host: portainer.local
easyhaproxy.http.port: 80
easyhaproxy.http.localport: 9000
volumes:
certs_certbot:
external: true
# certs_haproxy:
# external: true
portainer_data:
# external: true