Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
wangmingbo123 committed Nov 30, 2024
1 parent a9d61bf commit 17b8af6
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 使用 Node.js 官方镜像
FROM node:20-alpine

# 设置工作目录
WORKDIR /app

# 复制 package.json 和 package-lock.json
COPY package*.json ./

# 安装依赖
RUN npm install

RUN npm install next

# 复制项目文件
COPY . .

# 构建应用(如果需要)
RUN npm run build

# 暴露应用端口
EXPOSE 3000

# 启动应用
CMD ["npm", "start"]
32 changes: 32 additions & 0 deletions k8s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: SmartExcel
spec:
replicas: 1
selector:
matchLabels:
app: SmartExcel
template:
metadata:
labels:
app: SmartExcel
spec:
containers:
- name: SmartExcel
image: wangyuyu/smart-excel:latest
ports:
- containerPort: 3000
---
apiVersion: v1
kind: Service
metadata:
name: SmartExcel
spec:
type: NodePort
ports:
- port: 3000
targetPort: 3000
nodePort: 30001 # 可选,指定 NodePort
selector:
app: SmartExcel

0 comments on commit 17b8af6

Please sign in to comment.