added containers

portainer
master
David Kebler 2024-02-27 13:37:33 -08:00
parent fa11e34555
commit edfbbe7fe0
10 changed files with 72 additions and 0 deletions

25
containers/portainer.inst Executable file
View File

@ -0,0 +1,25 @@
portainer_install () {
local target
local dir="$(dirname $(realpath "${BASH_SOURCE:-$0}"))"
target=${1:-/opt/portainer}
[[ -d $target ]] || mkdir -p $target
echo installing portainer to $target
if /bin/cp -f $dir/portainer/* $target; then
pushd $target || return
echo PORTAINER_DIR=$target >> .env
source .env
mkdir -p ${DATA:-$target/data}
./config
./start
sleep 5
./logs
else
echo unable to copy portainer files to $target, install aborted
fi
popd || return
}
# if script was executed then call the function
(return 0 2>/dev/null) || portainer_install $@

View File

@ -0,0 +1,9 @@
#default 9000, uncomment and set
# PORT=9005
# default 8000, uncomment and set
# EDGE_PORT=8005
# default is /opt/portainer/data
# DATA=/mnt/extra/containers/EDGE_PORT=8005
# DATA superceeds PORTAINER_DIR and this is set by install script

2
containers/portainer/config Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
docker-compose config

View File

@ -0,0 +1,21 @@
version: "2"
services:
portainer:
container_name: portainer
image: portainer/portainer-ce:latest
restart: always
ports:
- "${PORT:-9000}:9000"
- "${EDGE_PORT:-8000}:8000"
command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- portainer_data:/data
volumes:
portainer_data:
driver_opts:
type: none
device: ${DATA:-${PORTAINER_DIR:-/opt/portainer}/data}
o: bind

2
containers/portainer/logs Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
docker-compose logs

2
containers/portainer/make Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
docker-compose up -d --force-recreate

3
containers/portainer/start Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
docker-compose down
docker-compose up -d

2
containers/portainer/stop Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
docker-compose down

2
containers/portainer/term Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
docker exec -it portainer /bin/sh

4
containers/portainer/upgrade Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
docker-compose down
docker-compose pull
docker-compose up -d