From a1dfbde51a8281d0bffe20e22b830032d09e2205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A3=BC=EC=98=81?= <103026521+jyk1029@users.noreply.github.com> Date: Thu, 29 Feb 2024 14:37:07 +0900 Subject: [PATCH] merge :: CD (#12) * add :: dockerfile, CD * chore :: codeformat --- .dockerignore | 4 ++++ .github/workflows/CD.yml | 22 ++++++++++++++++++++++ Dockerfile | 10 ++++++++++ 3 files changed, 36 insertions(+) create mode 100644 .dockerignore create mode 100644 .github/workflows/CD.yml create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..672791d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +Dockerfile +node_modules +npm-debug.log +dist \ No newline at end of file diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml new file mode 100644 index 0000000..c099b48 --- /dev/null +++ b/.github/workflows/CD.yml @@ -0,0 +1,22 @@ +name: CD + +on: + push: + branches: [ 'main' ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Login Docker + env: + DOCKER_USERNAME: ${{secrets.DOCKERHUB_USERNAME}} + DOCKER_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}} + run: docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + + - name: Build Docker Image + run: docker build -t jyk1029/emoting . + + - name: Push Docker Image + run: docker push jyk1029/emoting:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a7f930d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:18-alpine + +WORKDIR /app +ADD . /app/ + +RUN npm install +RUN npm run build + +EXPOSE 8080 +ENTRYPOINT npm run start \ No newline at end of file