From 3fbd835b4b4ea727f0fdf64a222eaa3a9162ec87 Mon Sep 17 00:00:00 2001 From: MTLantoine Date: Sat, 16 Jan 2021 14:39:40 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20add=20docker-compose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 24 +++++++++++++++++++++++- Dockerfile | 10 ++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.circleci/config.yml b/.circleci/config.yml index 737131f..a16ad4e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,9 +13,31 @@ jobs: paths: - ./node_modules key: npm-v2-dependencies-{{ checksum "yarn.lock" }} + + deploy: + docker: + - image: docker:17.05.0-ce-git + steps: + - checkout + - setup_remote_docker + - run: + name: Build application Docker image + command: | + docker build --cache-from=app -t app . + - deploy: + name: Publish application to docker hub + command: | + docker login -e $DOCKER_HUB_EMAIL -u $DOCKER_HUB_USER_ID -p $DOCKER_HUB_PWD + docker tag app $DOCKER_HUB_USER_ID/devops-project-front:$CIRCLE_BUILD_NUM + docker tag app $DOCKER_HUB_USER_ID/devops-project-front:latest + docker push $DOCKER_HUB_USER_ID/devops-project-front:$CIRCLE_BUILD_NUM + docker push $DOCKER_HUB_USER_ID/devops-project-front:latest workflows: version: 2 mybuild: jobs: - - build \ No newline at end of file + - build + - deploy: + requires: + - build \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..08f084a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:dubnium + +WORKDIR /nest-server + +COPY . . + +RUN yarn install + + +CMD ["yarn", "serve"]