diff --git a/docker-compose.yml b/docker-compose.yml index e2cc734..3c50dbf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,5 @@ version: "3.8" + services: code-server: image: ghcr.io/linuxserver/code-server @@ -13,7 +14,12 @@ services: volumes: - ${Config}:/config - ${Files}:/config/workspace - + - ${Deploy}:/config/workspace/.deploy ports: - ${Port}:8443 restart: unless-stopped + +networks: + # networks indentation moved to top level + default: + name: ${Name} diff --git a/editors/example.cfg b/editors/example.cfg index 4c269dc..d419f41 100644 --- a/editors/example.cfg +++ b/editors/example.cfg @@ -1,8 +1,9 @@ #!/bin/bash +# will user filename unless second argument is passed to make-env-file # Name=containername # USER=jim # TZ=America/Los_Angles # Password=jimshoe -Parent_Folder=/data -Files=/data/test-files # will be /data/ by default +# Parent_Folder=/data +#Files= # will be /files by default Port=4321 # should be changed to avoid conflict with other containers diff --git a/make-env-file b/make-env-file index 0dcda8d..e11f825 100755 --- a/make-env-file +++ b/make-env-file @@ -27,10 +27,14 @@ ename=${2:-$(basename "${1%.*}")} __ce_Name=${Name:-$ename-files-editor} __ce_TZ=${TZ:-"America/Los_Angeles"} __ce_Password=${Password:-password} +__ce_Deploy=${WEB_GENERATOR:-/opt/web-generator/deploy/$1} +if [[ ! -p $__ce_Deploy ]]; then + mkfifo $__ce_Deploy +fi Parent_Folder=${Parent_Folder:-${HOME}/.local/share/code-edit} -__ce_Files=${Files:-${Parent_Folder}/$ename/files} +__ce_Files=${Files:-${Parent_Folder}/$1/files} mkdir -p ${__ce_Files} -__ce_Config=${Config:-${Parent_Folder}/$ename/config} +__ce_Config=${Config:-${Parent_Folder}/$1/config} mkdir -p ${__ce_Config} __ce_Port=${Port:-8443} diff --git a/stop b/stop index 68fb53e..8b6e52a 100755 --- a/stop +++ b/stop @@ -3,4 +3,5 @@ SDIR=$(cd $(dirname $(readlink -f "$0")) >/dev/null 2>&1 ; pwd -P) env_file=$SDIR/editors/docker.${1}.env [[ ! -f $env_file ]] && $($SDIR/make-env-file $1) +docker container stop $1-files-editor docker-compose --env-file $SDIR/editors/docker.${1}.env down