From 2cb681ef13d1ed380d3c71a83c2c4318617be8a7 Mon Sep 17 00:00:00 2001 From: derrabauke <pfralf@googlemail.com> Date: Fri, 12 Mar 2021 19:59:10 +0100 Subject: [PATCH] created a dockerfile for the client/frontend --- .gitlab-ci.yml | 4 ++++ app/client/Dockerfile | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 app/client/Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb69d70..a68f99c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,3 +35,7 @@ test_server: - npm install - npm run test +build_client: + stage: build + script: + - docker build -f app/client/Dockerfile -t client:v0.0.1 client diff --git a/app/client/Dockerfile b/app/client/Dockerfile new file mode 100644 index 0000000..5819965 --- /dev/null +++ b/app/client/Dockerfile @@ -0,0 +1,24 @@ +# Build a release +FROM node:12.16.3 as build + +RUN mkdir /usr/src/app + +WORKDIR /usr/src/app +ENV PATH /usr/src/app/node_modules/.bin:$PATH + +COPY package.json /usr/src/app/package.json + +RUN npm install + +COPY . /usr/src/app + +RUN npm run build + +# Put this stuff into a nginx server +FROM nginx:latest +# copy from previous build to this image +COPY --from=build /usr/src/app/build /usr/share/nginx/html + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] -- GitLab