diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..56b0d160 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,45 @@ +FROM node:lts-buster-slim + +MAINTAINER Dave Stephens + +ENV NVM_DIR /root/.nvm +ENV DEBIAN_FRONTEND noninteractive + +COPY . /enigma-bbs + +# Do some installing! +RUN apt-get update && apt-get install -y \ + git \ + curl \ + build-essential \ + python \ + libssl-dev \ + lrzsz \ + arj \ + lhasa \ + unrar-free \ + p7zip-full \ + && npm install -g pm2 \ + && cd /enigma-bbs && npm install --only=production \ + && apt-get remove build-essential python libssl-dev git curl -y && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && apt-get clean + +# sexyz +COPY docker/bin/sexyz /usr/local/bin + +# enigma storage mounts +VOLUME /enigma-bbs/art +VOLUME /enigma-bbs/config +VOLUME /enigma-bbs/db +VOLUME /enigma-bbs/filebase +VOLUME /enigma-bbs/logs +VOLUME /enigma-bbs/mods +VOLUME /mail + +# Enigma default port +EXPOSE 8888 + +WORKDIR /enigma-bbs + +CMD ["pm2-runtime", "main.js"] diff --git a/docker/bin/sexyz b/docker/bin/sexyz new file mode 100755 index 00000000..36924822 Binary files /dev/null and b/docker/bin/sexyz differ diff --git a/docs/installation/docker.md b/docs/installation/docker.md index c9473e2b..776c0440 100644 --- a/docs/installation/docker.md +++ b/docs/installation/docker.md @@ -3,20 +3,47 @@ layout: page title: Docker --- **You'll need Docker installed before going any further. How to do so are out of scope of these docs, but you can find full instructions -for every operating system on the [Docker website](https://docs.docker.com/engine/installation/).** +for every operating system on the [Docker website](https://docs.docker.com/engine/install/).** ## Quick Start -Download and run the ENiGMA½ BBS image: - docker run -d \ - -p 8888:8888 \ - davestephens/enigma-bbs:latest +- Generate some config for your BBS: + ``` + docker run -it -v "${HOME}/engima-bbs/config:/enigma-bbs/config" enigmabbs/enigma-bbs:latest oputil.js config new + ``` -:warning: This is a **very basic** example! As no config has been supplied the container will use a basic one so that it starts successfully. Note that as no persistence directory has been supplied, once the container stops any changes made will be lost! +- Run it: + ``` + docker run -p 8888:8888 -v "${HOME}/engima-bbs/config:/enigma-bbs/config enigmabbs/enigma-bbs:latest + ``` -:bulb: [Volumes](https://docs.docker.com/storage/volumes/) may be used for things such as your configuration and database path. +:bulb: Configuration will be stored in `${HOME}/engima-bbs/config`. -## Customized Docker Setup -TBC using Docker Compose +:bulb: Windows users - you'll need to switch out `${HOME}/engima-bbs/config` for a Windows-style path. -:pencil: This area is looking for contributors! +## Volumes + +Containers by their nature are ephermeral. Meaning, stuff you want to keep (config, database, mail) needs +to be stored outside of the running container. As such, the following volumes are mountable: + +| Volume | Usage | +|:------------------------|:---------------------------------------------------------------------| +| /enigma-bbs/art | Art, themes, etc | +| /enigma-bbs/config | Config such as config.hjson, menu.hjson, prompt.hjson, SSL certs etc | +| /enigma-bbs/db | ENiGMA databases | +| /enigma-bbs/filebase | Filebase | +| /enigma-bbs/logs | Logs | +| /enigma-bbs/mods | ENiGMA mods | +| /mail | FTN mail (for use with an external mailer) | + + +## Building your own image + +Customising the Docker image is easy! + +1. Clone the ENiGMA-BBS source. +2. Build the image + + ``` + docker build -f ./docker/Dockerfile . + ``` \ No newline at end of file