initial commit
This commit is contained in:
21
docker_portainer_stacks/portainer/README.md
Normal file
21
docker_portainer_stacks/portainer/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# Portainer
|
||||
|
||||
Docker-compose stack with Portainer, VSCode, WatchTower
|
||||
|
||||
|
||||
Install with 1 line cmd (running as sudo/root)
|
||||
```
|
||||
clear;bash -c "$(wget -qLO - https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/portainer/script/install_nosudo)"
|
||||
```
|
||||
|
||||
download docker-compose.yml with:
|
||||
```
|
||||
wget https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/portainer/docker-compose.yml
|
||||
```
|
||||
|
||||
# Portainer Agent
|
||||
|
||||
```
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/portainer/install-portainer-agent)" EDGE_ID EDGE_KEY
|
||||
```
|
||||
Replace `EDGE_ID` and `EDGE_KEY` with ones given by Portainer
|
48
docker_portainer_stacks/portainer/docker-compose.yml
Normal file
48
docker_portainer_stacks/portainer/docker-compose.yml
Normal file
@ -0,0 +1,48 @@
|
||||
---
|
||||
version: "3.8"
|
||||
services:
|
||||
portainer:
|
||||
container_name: portainer
|
||||
image: portainer/portainer-ce:latest
|
||||
restart: unless-stopped
|
||||
network_mode: bridge
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ~/docker/portainer:/data
|
||||
ports:
|
||||
- 8000:8000
|
||||
- 9000:9000
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
||||
|
||||
vscode:
|
||||
image: ghcr.io/linuxserver/code-server:latest
|
||||
container_name: vscode
|
||||
network_mode: bridge
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Amsterdam
|
||||
- PASSWORD=bTWsTrs5uyuJjz6PG6
|
||||
- SUDO_PASSWORD=TKMSajXxJ9Pj9uDFe4
|
||||
volumes:
|
||||
- ~/docker/vscode:/config
|
||||
- ~/docker:/config/workspace/server
|
||||
ports:
|
||||
- 8443:8443
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true
|
||||
|
||||
watchtower:
|
||||
container_name: watchtower
|
||||
image: containrrr/watchtower:latest
|
||||
restart: unless-stopped
|
||||
network_mode: bridge
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
- TZ=Europe/Amsterdam
|
||||
- WATCHTOWER_CLEANUP=true
|
||||
- WATCHTOWER_POLL_INTERVAL=86400
|
||||
- WATCHTOWER_LABEL_ENABLE=true
|
22
docker_portainer_stacks/portainer/install-portainer-agent
Normal file
22
docker_portainer_stacks/portainer/install-portainer-agent
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
###################################
|
||||
############ by Sthope ############
|
||||
###################################
|
||||
|
||||
#### USAGE
|
||||
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/portainer/install-portainer-agent)" EDGE_ID EDGE_KEY
|
||||
#
|
||||
|
||||
sudo docker run -d \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /var/lib/docker/volumes:/var/lib/docker/volumes \
|
||||
-v /:/host \
|
||||
-v portainer_agent_data:/data \
|
||||
--restart always \
|
||||
-e EDGE=1 \
|
||||
-e EDGE_ID=${1} \
|
||||
-e EDGE_KEY=${2} \
|
||||
-e CAP_HOST_MANAGEMENT=1 \
|
||||
--label=hide_container=true \
|
||||
--name portainer_edge_agent \
|
||||
portainer/agent
|
24
docker_portainer_stacks/portainer/script/install_nosudo
Normal file
24
docker_portainer_stacks/portainer/script/install_nosudo
Normal file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
###################################
|
||||
############ by Sthope ############
|
||||
###################################
|
||||
|
||||
## nano ~/.bashrc
|
||||
## and add this to the end of the file: export PATH=$PATH:~/bin
|
||||
## sudo chmod +x ~/bin/*;su -l $USER
|
||||
|
||||
#### USAGE
|
||||
# bash -c "$(wget -qLO - https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/portainer/script/install_nosudo)"
|
||||
#
|
||||
|
||||
apt-get update
|
||||
apt-get upgrade -y
|
||||
|
||||
bash -c "$(wget -qLO - https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/docker-compose/config.sh)"
|
||||
|
||||
mkdir -p /docker/portainer
|
||||
mkdir -p /docker/vscode
|
||||
|
||||
wget https://git.sthope.dev/sthope/docker_portainer_stacks/raw/branch/master/portainer/docker-compose.yml -P /docker/
|
||||
|
||||
cd /test/;docker-compose up -d
|
Reference in New Issue
Block a user