From 915caf12dd7294203910a9ebeb199b7f09e76881 Mon Sep 17 00:00:00 2001 From: Jonathan Gramain Date: Fri, 12 Feb 2021 16:19:16 -0800 Subject: [PATCH] improvement: S3C-3776 Dockerfile for kubernetes deployment Add a Dockerfile that will be used by eve to build images suitable for a dev kubernetes deployment --- .dockerignore | 2 ++ Dockerfile | 32 ++++++++++++++++++++++++++++++++ docker-entrypoint.sh | 6 ++++++ 3 files changed, 40 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100755 docker-entrypoint.sh 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 "$@"