diff --git a/Dockerfile b/Dockerfile index c62cc6b9d86566bdf1bc62de31a62c7a6e20017b..93884d98063e1682023cfb00d61f060707df925c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -94,4 +94,4 @@ COPY root/ / # Communicate ports and volumes to be used EXPOSE 8080 -VOLUME /config /data /plugins +VOLUME /config /data /plugins /code diff --git a/README.md b/README.md index 8eaaf2046e8eebdf265756d5277fcbf404db2ea9..f8fb23812fa77739f70c141d0e1314c6373c274e 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ services: image: griefed/icecoder restart: unless-stopped volumes: + - ./icecoder/code:/code - ./icecoder/config:/config - ./icecoder/data:/data - ./icecoder/plugins:/plugins @@ -44,10 +45,11 @@ services: Configuration | Explanation ------------ | ------------- -restart | [Restart policy](https://docs.docker.com/compose/compose-file/#restart) Either: "no", always, on-failure, unless-stopped -volumes | /config contains all relevant configuration files. -volumes | /data contains all relevant data like code. /data/code is the directory where GITURL is cloned into, for example. -volumes | /plugins contains all plugin files. +[Restart policy](https://docs.docker.com/compose/compose-file/#restart) | "no", always, on-failure, unless-stopped +code volume | Contains GITURL repository. +config volume | Contains config files and logs. +data volume | Contains ICEcoder data like backups. +plugins volume | Contains all plugin files. GITURL | Specify a GitHub repository to checkout on first run of the container. TZ | Timezone PUID | for UserID diff --git a/root/etc/cont-init.d/60-config b/root/etc/cont-init.d/60-config index 9821c6177ad8a6a72b1960afa9b22d5753a129bd..ccee3cad0ea8e2cf10bb5f1573025645e15dc6f8 100644 --- a/root/etc/cont-init.d/60-config +++ b/root/etc/cont-init.d/60-config @@ -10,11 +10,11 @@ if [ ! -e /lock.file ]; then -i /etc/sudoers sed -e 's/^wheel:\(.*\)/wheel:\1,abc/g' -i /etc/group # create directory for project - mkdir -p /data/code + mkdir -p /code/ICEcoder # make sure URL is set and folder is empty to clone code - if [ ${GITURL+x} ] && [ ! "$(/bin/ls -A /data/code 2>/dev/null)" ] ; then \ + if [ ${GITURL+x} ] && [ ! "$(/bin/ls -A /data/code/ICEcoder 2>/dev/null)" ] ; then \ # clone the url the user passed to this directory - git clone "${GITURL}" /data/code + git clone "${GITURL}" /code/ICEcoder fi else # lock exists not importing project this is a restart @@ -36,6 +36,7 @@ cp /config/php/php.ini /etc/php7/php.ini # Link data, code and plugins sudo -u abc ln -sf /data /app/ICEcoder/data sudo -u abc ln -sf /plugins /app/ICEcoder/plugins +sudo -u abc ln -sf /code /app/ICEcoder/code # permissions mkdir -p /config/sessions @@ -45,10 +46,12 @@ chown -R abc:abc \ /app/ICEcoder \ /data \ /config \ - /plugins + /plugins \ + /code chmod -R 775 \ /app/ICEcoder \ /data \ /config \ - /plugins + /plugins \ + /code