From 5f914a0a6fb5949dc16fdc1be6eb268747c991ee Mon Sep 17 00:00:00 2001 From: Allen Zhang Date: Wed, 13 Dec 2023 20:22:38 +0800 Subject: [PATCH] update --- .github/workflows/publish-docker.yml | 29 ++++++++++++++++++++++++++++ Dockerfile | 14 ++++++++++++++ package.json | 2 +- 3 files changed, 44 insertions(+), 1 deletion(-) 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 0000000..3d4a2d2 --- /dev/null +++ b/.github/workflows/publish-docker.yml @@ -0,0 +1,29 @@ +name: push docker image + +on: + push: + branches: + - 'main' + +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-docs:main diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..85743b0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:lts + +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 ["pnpm", "run", "start" ] diff --git a/package.json b/package.json index 7b2a971..3e70d34 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "next", "build": "next build", - "start": "next start -p 18888" + "start": "next start -p 8080" }, "keywords": [], "author": "",