- Updated .env.example to reflect new LLM configuration with Aliyun's API. - Enhanced .gitignore to include additional files and directories for better exclusion of sensitive and build artifacts. - Added docker-compose.yml for streamlined deployment of backend and frontend services. - Introduced Dockerfiles for both backend and frontend to facilitate containerized builds. - Created README.md to provide comprehensive project documentation and setup instructions. - Established nginx configuration for frontend to support API proxying and static file serving.
34 lines
597 B
Docker
34 lines
597 B
Docker
# MiroFish Frontend Dockerfile
|
|
# Multi-stage build: Node.js build + Nginx serve
|
|
|
|
# ============= Build Stage =============
|
|
FROM node:20-alpine as builder
|
|
|
|
WORKDIR /app
|
|
|
|
# 复制 package 文件
|
|
COPY package*.json ./
|
|
|
|
# 安装依赖
|
|
RUN npm ci
|
|
|
|
# 复制源代码
|
|
COPY . .
|
|
|
|
# 构建生产版本
|
|
RUN npm run build
|
|
|
|
# ============= Production Stage =============
|
|
FROM nginx:alpine
|
|
|
|
# 复制 Nginx 配置
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# 复制构建产物
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# 暴露端口
|
|
EXPOSE 80
|
|
|
|
# 启动 Nginx
|
|
CMD ["nginx", "-g", "daemon off;"]
|