From 5c566648a0a8990ae483ae716dcec74316e76888 Mon Sep 17 00:00:00 2001 From: derrabauke <pfralf@googlemail.com> Date: Fri, 12 Mar 2021 22:43:43 +0100 Subject: [PATCH] add docker file for the server --- .gitlab-ci.yml | 2 +- app/client/Dockerfile | 2 +- app/client/chart/client/values.yaml | 2 +- app/server/Dockerfile | 15 +++++++++++++++ 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 app/server/Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index febafed..d82502b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -45,6 +45,6 @@ build_client: - docker:19.03.12-dind stage: build script: - - docker build -f app/client/Dockerfile -t client:v0.0.1 . + - docker build -f app/client/Dockerfile -t ${}client:v0.0.1 . only: - master diff --git a/app/client/Dockerfile b/app/client/Dockerfile index 5819965..8fa3e66 100644 --- a/app/client/Dockerfile +++ b/app/client/Dockerfile @@ -16,7 +16,7 @@ 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 diff --git a/app/client/chart/client/values.yaml b/app/client/chart/client/values.yaml index 6e19641..bb04687 100644 --- a/app/client/chart/client/values.yaml +++ b/app/client/chart/client/values.yaml @@ -5,7 +5,7 @@ replicaCount: 1 image: - repository: nginx + repository: nginx # !Change this to the actual image pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" diff --git a/app/server/Dockerfile b/app/server/Dockerfile new file mode 100644 index 0000000..1a9fa79 --- /dev/null +++ b/app/server/Dockerfile @@ -0,0 +1,15 @@ +FROM node:12.16.3 + +WORKDIR "/usr/app" + +COPY package*.json ./ + +COPY . . + +RUN npm install --production + +ENV PORT 3002 +ENV NODE_ENV production + +EXPOSE 3002 +CMD ["npm", "start"] -- GitLab