Created
May 4, 2023 08:15
-
-
Save tetra-fox/03e7cc9e86bafc88640ef8761a110002 to your computer and use it in GitHub Desktop.
simple portainer setup
This file contains hidden or 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
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: |
This file contains hidden or 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
#!/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