parent
fa11e34555
commit
edfbbe7fe0
|
@ -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 $@
|
|
@ -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
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
docker-compose config
|
|
@ -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
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
docker-compose logs
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
docker-compose up -d --force-recreate
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
docker-compose down
|
||||
docker-compose up -d
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
docker-compose down
|
|
@ -0,0 +1,2 @@
|
|||
#!/bin/bash
|
||||
docker exec -it portainer /bin/sh
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
docker-compose down
|
||||
docker-compose pull
|
||||
docker-compose up -d
|
Loading…
Reference in New Issue