move docker container config location to variable

This commit is contained in:
Ray Elliott 2020-03-04 13:37:59 +00:00
parent 13f6ad468c
commit d7a051ed93
1 changed files with 8 additions and 7 deletions

View File

@ -6,6 +6,7 @@
_lets_encrypt_email="wptest@isnet.uk" _lets_encrypt_email="wptest@isnet.uk"
_server_base_url="wptest.isnet.uk" _server_base_url="wptest.isnet.uk"
_docker_container_config_dir="/var/docker"
_docker_compose_version="1.25.4" _docker_compose_version="1.25.4"
# add user # add user
@ -47,12 +48,12 @@ _HT_PASSWD=$(htpasswd -nB ray | sed -e 's/\$/\$\$/g')
docker network create web docker network create web
mkdir -p /var/docker/traefik mkdir -p "$_docker_container_config_dir"/traefik
mkdir -p /var/docker/portainer mkdir -p "$_docker_container_config_dir"/portainer
touch /var/docker/traefik/acme.json touch "$_docker_container_config_dir"/traefik/acme.json
chmod 600 /var/docker/traefik/acme.json chmod 600 "$_docker_container_config_dir"/traefik/acme.json
cd /var/docker/traefik || exit 20 cd "$_docker_container_config_dir"/traefik || exit 20
echo "api: echo "api:
dashboard: true dashboard: true
@ -115,8 +116,8 @@ networks:
" >> docker-compose.yml " >> docker-compose.yml
docker-compose up -d docker-compose up -d
cd /var/docker/portainer || exit 30 cd "$_docker_container_config_dir"/portainer || exit 30
# create /var/docker/portainer/docker-compose.yml # create "$_docker_container_config_dir"/portainer/docker-compose.yml
_portainer_url="portainer.$_server_base_url" _portainer_url="portainer.$_server_base_url"
echo "version: '3' echo "version: '3'