Skip to content

Commit

Permalink
fix deploy docker
Browse files Browse the repository at this point in the history
  • Loading branch information
incubator4 committed Jan 10, 2024
1 parent 5e406f8 commit fba20a0
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-and-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and Deploy
on:
push:
branches:
- main
tags:
- v*
jobs:
build:
uses: NaturalSelectionLabs/Daedalus/.github/workflows/docker-tpl.yaml@main
with:
images: rss3/gcp-iam-explorer
context: ./packages/web
dockerfile: ./Dockerfile
secrets: inherit
# deploy:
# uses: NaturalSelectionLabs/Daedalus/.github/workflows/deploy-v3-tpl.yaml@main
# needs:
# - build
# with:
# images: rss3/gcp-iam-explorer
# tag: sha-${{ github.sha }}
# cluster: prod
# namespace: guardian
# releaseName: gcp-iam-explorer
# revision: main
# dir: deploy/prod
# secrets: inherit
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 使用 Node.js 14 作为基础镜像
FROM node:12.12-alpine

# 设置工作目录
WORKDIR /app

# 复制 package.json 和 yarn.lock 到工作目录
COPY package.json ./

# 安装项目依赖
RUN npm install

# 复制整个项目到工作目录
COPY . .

# 构建 Next.js 应用
RUN npm run build

# 暴露应用运行的端口(默认为 3000)
EXPOSE 3000

# 启动 Next.js 应用
CMD ["yarn", "start"]

0 comments on commit fba20a0

Please sign in to comment.