diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..33331455 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.hg +settings.json +src/node_modules diff --git a/docker/Dockerfile b/Dockerfile similarity index 68% rename from docker/Dockerfile rename to Dockerfile index 24e93f08..41f86f49 100644 --- a/docker/Dockerfile +++ b/Dockerfile @@ -3,16 +3,10 @@ # https://github.com/ether/etherpad-lite # # Author: muxator -# -# Version 0.1 FROM node:10-buster-slim LABEL maintainer="Etherpad team, https://github.com/ether/etherpad-lite" -# git hash of the version to be built. -# If not given, build the latest development version. -ARG ETHERPAD_VERSION=develop - # plugins to install while building the container. By default no plugins are # installed. # If given a value, it has to be a space-separated, quoted list of plugin names. @@ -25,24 +19,10 @@ ARG ETHERPAD_PLUGINS= # this can be done with build args (and is mandatory to build ARM version) ENV NODE_ENV=development -# grab the ETHERPAD_VERSION tarball from github (no need to clone the whole -# repository) -RUN echo "Getting version: ${ETHERPAD_VERSION}" && \ - curl \ - --location \ - --fail \ - --silent \ - --show-error \ - --output /opt/etherpad-lite.tar.gz \ - https://github.com/ether/etherpad-lite/archive/"${ETHERPAD_VERSION}".tar.gz && \ - mkdir /opt/etherpad-lite && \ - tar xf /opt/etherpad-lite.tar.gz \ - --directory /opt/etherpad-lite \ - --strip-components=1 && \ - rm /opt/etherpad-lite.tar.gz - WORKDIR /opt/etherpad-lite +COPY ./ ./ + # install node dependencies for Etherpad RUN bin/installDeps.sh && \ rm -rf ~/.npm/_cacache @@ -54,7 +34,7 @@ RUN bin/installDeps.sh && \ RUN for PLUGIN_NAME in ${ETHERPAD_PLUGINS}; do npm install "${PLUGIN_NAME}"; done # Copy the configuration file. -COPY ./settings.json /opt/etherpad-lite/ +COPY ./docker/settings.json /opt/etherpad-lite/settings.json # Follow the principle of least privilege: run as unprivileged user. # diff --git a/doc/docker.md b/doc/docker.md index d40810a6..4e0f9abb 100644 --- a/doc/docker.md +++ b/doc/docker.md @@ -35,26 +35,11 @@ Some plugins will need personalized settings in the `settings.json` file. Just r ### Examples -Build the latest development version: +Build a Docker image from the currently checked-out code: ```bash docker build --tag /etherpad . ``` -Build the latest stable version: -```bash -docker build --build-arg ETHERPAD_VERSION=master --build-arg NODE_ENV=production --tag /etherpad . -``` - -Build a specific tagged version: -```bash -docker build --build-arg ETHERPAD_VERSION=1.7.5 --build-arg NODE_ENV=production --tag /etherpad . -``` - -Build a specific git hash: -```bash -docker build --build-arg ETHERPAD_VERSION=4c45ac3cb1ae --tag /etherpad . -``` - Include two plugins in the container: ```bash docker build --build-arg ETHERPAD_PLUGINS="ep_codepad ep_author_neat" --tag /etherpad .