From dadb89ab745601a050e37b97a35156b67cde99fa Mon Sep 17 00:00:00 2001 From: Allen Zhang <37892968+zhangtao25@users.noreply.github.com> Date: Mon, 9 Oct 2023 17:25:54 +0800 Subject: [PATCH] feat: update dockerfile --- .github/workflows/publish-docker.yml | 29 ++++++++++++++++++++++++++++ Dockerfile | 14 ++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 .github/workflows/publish-docker.yml create mode 100644 Dockerfile diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml new file mode 100644 index 00000000..6b4120a0 --- /dev/null +++ b/.github/workflows/publish-docker.yml @@ -0,0 +1,29 @@ +name: ci + +on: + push: + branches: + - 'next' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + tags: zhangtao25/canyon:${{ steps.extract_branch.outputs.branch }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..8e7c0db1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:lts-alpine + +MAINTAINER wr_zhang25 + +RUN mkdir -p /app +COPY . /app/ +WORKDIR /app + +RUN npm install pnpm -g +RUN pnpm i +RUN pnpm run build + +EXPOSE 8080 +CMD ["node", "packages/app-backend/dist/main.js" ]