build: 添加 Docker 相关配置文件

添加 Dockerfile、docker-compose.yml 和 .dockerignore 文件,用于容器化部署开发环境
This commit is contained in:
史悦
2026-01-22 16:18:05 +08:00
parent 15e0fa415c
commit 4186c4289b
3 changed files with 42 additions and 0 deletions

13
.dockerignore Normal file
View File

@@ -0,0 +1,13 @@
node_modules
.git
.gitignore
.vite
dist
*.log
.env
.env.local
.env.*.local
coverage
.nyc_output
.DS_Store
Thumbs.db

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 5173
CMD ["npm", "run", "dev", "--", "--host"]

16
docker-compose.yml Normal file
View File

@@ -0,0 +1,16 @@
version: '3.8'
services:
thinkflow:
build:
context: .
dockerfile: Dockerfile
container_name: thinkflow-app
ports:
- "5173:5173"
volumes:
- .:/app
- /app/node_modules
environment:
- NODE_ENV=development
restart: unless-stopped