From db8baa758de761b506cce2eb5d82bd6c2e69f1ac Mon Sep 17 00:00:00 2001 From: M0Bruno Date: Thu, 18 Jul 2019 15:50:33 +0200 Subject: [PATCH] feat: refs #109849 setup ci config --- .dockerignore | 5 +++++ .gitignore | 4 ++-- .gitlab-ci.yml | 3 +++ Dockerfile | 23 +++++++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a030541 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules/ +logs/ +.env +src/front/build +docker \ No newline at end of file diff --git a/.gitignore b/.gitignore index 66dba91..1ebcf3b 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ yarn-error.log .env logs/ .DS_Store -src/front/build -spec/coverage \ No newline at end of file +spec/coverage +build \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8981fd4..5bcfb26 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,6 +5,9 @@ cache: paths: - node_modules/ +script: + - apk --no-cache add --virtual builds-deps build-base python + stages: - build - test diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b90bb35 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM node:12-alpine as builder + +COPY . /usr/src/app + +WORKDIR /usr/src/app + +RUN apk update && \ + apk upgrade && \ + apk --no-cache add --virtual builds-deps build-base python && \ + yarn && \ + yarn build && \ + rm -r ./node_modules && \ + yarn --production && \ + touch .env +# End of build stage + +FROM node:12-alpine + +COPY --from=builder /usr/src/app /usr/src/app + +WORKDIR /usr/src/app + +CMD [ "yarn", "start" ]