diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..be0443aea --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules/ +.git/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..f11edbbb1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM node:10-slim + +WORKDIR /usr/src/app + +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + ca-certificates \ + build-essential \ + libssl-dev \ + wget \ + bash \ + python \ + git \ + jq + +ENV DOCKERIZE_VERSION v0.6.1 +RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz + +COPY package.json yarn.lock /usr/src/app/ +RUN yarn install --frozen-lockfile --production \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf ~/.node-gyp \ + && rm -rf /tmp/yarn-* \ + && mkdir /conf + +COPY . /usr/src/app/ + +ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"] + +EXPOSE 8900 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 000000000..ea7758ec9 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# set -e stops the execution of a script if a command or pipeline has an error +set -e + +exec "$@"