diff --git a/.circleci/config.yml b/.circleci/config.yml index c5adf51..f2732c6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,4 +20,23 @@ jobs: - save_cache: key: npm-v1-dependencies-{{ checksum "yarn.lock" }} paths: - - ./node_modules \ No newline at end of file + - ./node_modules + docker-build-and-push: + working_directory: /dockerapp + 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/docker-final-front:$CIRCLE_BUILD_NUM + docker tag app $DOCKER_HUB_USER_ID/docker-final-front:latest + docker push $DOCKER_HUB_USER_ID/docker-final-front:$CIRCLE_BUILD_NUM + docker push $DOCKER_HUB_USER_ID/docker-final-front:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 1f77ca0..10a9b3a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ FROM node:dubnium -WORKDIR /nest-server +WORKDIR /devops-final-front COPY . . RUN yarn install -CMD ["yarn", "start"] \ No newline at end of file +CMD ["yarn", "serve"] \ No newline at end of file