diff --git a/docker/Dockerfile b/docker/Dockerfile index 1784e250..f143d0d6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -13,7 +13,6 @@ RUN apt-get update \ git \ curl \ build-essential \ - python3 \ python \ libssl-dev \ lrzsz \ @@ -37,6 +36,7 @@ RUN apt-get update \ # sexyz COPY docker/bin/sexyz /usr/local/bin +RUN chmod +x /enigma-bbs/docker/bin/docker-entrypoint.sh # enigma storage mounts VOLUME /enigma-bbs/art diff --git a/docker/bin/docker-entrypoint.sh b/docker/bin/docker-entrypoint.sh index 1e0927d2..1a6c6e3d 100644 --- a/docker/bin/docker-entrypoint.sh +++ b/docker/bin/docker-entrypoint.sh @@ -1,8 +1,13 @@ #!/usr/bin/env bash -prepopvols=("config" "mods" "art") -bbspath=/enigma-bbs -bbsstgp=/enigma-bbs-pre -if [[ ! -f $bbspath/config/config.hjson ]]; then + +# Set some vars +prepopvols=("config" "mods" "art") # these are folders which contain runtime needed files, and need to be represented in the host +bbspath=/enigma-bbs # install location +bbsstgp=/enigma-bbs-pre # staging location for prepopvals +configname=config.hjson # this is the default name, this script is intended for easy get-go - make changes as needed + +# Setup happens when there is no existing config file +if [[ ! -f $bbspath/config/$configname ]]; then for dir in "${prepopvols[@]}" do if [ -n "$(find "$bbspath/$dir" -maxdepth 0 -type d -empty 2>/dev/null)" ]; then @@ -13,4 +18,9 @@ if [[ ! -f $bbspath/config/config.hjson ]]; then done ./oputil.js config new fi -pm2-runtime main.js \ No newline at end of file +if [[ ! -f $bbspath/config/$configname ]]; then #make sure once more, otherwise pm2-runtime will loop if missing the config + echo "for some reason you have skipped configuration - enigma will not work. please run config" + exit 1 +else + pm2-runtime main.js +fi diff --git a/docs/installation/docker.md b/docs/installation/docker.md index 39ce70df..13cf0985 100644 --- a/docs/installation/docker.md +++ b/docs/installation/docker.md @@ -19,7 +19,7 @@ docker run -it --rm -p 8888:8888 \ -v "$(pwd)/art:/enigma-bbs/art" \ -v "$(pwd)/mods:/enigma-bbs/mods" \ -v "$(pwd)/mail:/mail" \ -enigmabbs:latest +enigmabbs/enigmabbs:latest ``` - Run it: \ you can use the same command as above, just daemonize and drop interactiveness (we needed it for config but most of the time docker will run in the background) @@ -33,8 +33,8 @@ docker run -d --rm -p 8888:8888 \ -v "$(pwd)/art:/enigma-bbs/art" \ -v "$(pwd)/mods:/enigma-bbs/mods" \ -v "$(pwd)/mail:/mail" \ -enigmabbs:latest -``` +enigmabbs/enigmabbs:latest +```` :bulb: Configuration will be stored in `$(pwd)/enigma-bbs/config`.