Skip to content

Instantly share code, notes, and snippets.

@tetra-fox
Created May 4, 2023 08:15
Show Gist options
  • Save tetra-fox/03e7cc9e86bafc88640ef8761a110002 to your computer and use it in GitHub Desktop.
Save tetra-fox/03e7cc9e86bafc88640ef8761a110002 to your computer and use it in GitHub Desktop.
simple portainer setup
version: "3.8"
services:
portainer_agent:
image: portainer/agent:latest
container_name: portainer_agent
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/volumes:/var/lib/docker/volumes
restart: always
portainer:
image: portainer/portainer-ee:latest
container_name: portainer
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- data:/data
restart: always
ports:
- "8000:8000"
- "9443:9443"
command: -H tcp://portainer_agent:9001 --tlsskipverify
volumes:
data:
#!/bin/bash
# stop & remove existing containers
if docker ps -a | grep -q portainer; then
docker stop portainer
docker container rm portainer
fi
if docker ps -a | grep -q portainer_agent; then
docker stop portainer_agent
docker container rm portainer_agent
fi
# pull latest images
docker pull portainer/portainer-ee:latest
docker pull portainer/agent:latest
# start the stack
docker compose -f portainer.yml -p portainer up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment