#
Portainer
Warning
This page is still a work in progress!
What is Portainer and Why Do I Use It?
Portainer is a lightweight management GUI for containerised applications that works with Docker, Kubernetes, or even Swarm and ACI environments, simplifying the deployment and management of containerised applications and services while improving efficiency. -Jack W., The New Stack
I use Portainer to manage and deploy my Docker environments with ease through its GUI. It also allows me to easily handle Docker's resources, such as its containers, images, networks, and stacks with no hassle. Additionally, if a container requires any sort of troubleshooting or fixes, I can quickly spin up a web terminal in Portainer to make those necessary changes.
#
1. Prerequisites
- Docker and Docker Compose
- Run and manage multi-container setups.
For installation and configuration details, please refer to the official Portainer Documentation.
#
Docker Compose Configuration
Below is the Docker Compose file for deploying Portainer with Traefik as a reverse proxy:
services:
portainer:
image: portainer/portainer-ce
container_name: portainer
restart: unless-stopped
security_opt:
- no-new-privileges: true
networks:
- proxy
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./data:/data
labels:
- "traefik.enable=true"
- "traefik.http.routers.portainer.entrypoints=http"
- "traefik.http.routers.portainer.rule=Host(`portainer.example.com`)"
- "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.example.com`)"
- "traefik.http.routers.portainer-secure.tls=true"
- "traefik.http.routers.portainer-secure.service=portainer"
- "traefik.http.services.portainer.loadbalancer.server.port=9000"
- "traefik.docker.network=proxy"
networks:
proxy:
external: true
Note
This docker-compose.yml file integrates Traefik, a reverse proxy and load balancer.