Refactor project structure by removing Docker support and updating environment configuration
- Deleted docker-compose.yml, backend Dockerfile, frontend Dockerfile, and nginx configuration to streamline project setup. - Updated .env.example to reorganize LLM and ZEP API configurations for clarity and ease of use. - Enhanced README.md to reflect changes in project structure and provide clearer setup instructions.
This commit is contained in:
@@ -1,59 +0,0 @@
|
||||
# MiroFish Backend Dockerfile
|
||||
# Multi-stage build for smaller image size
|
||||
|
||||
# ============= Build Stage =============
|
||||
FROM python:3.11-slim AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 安装构建依赖
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 复制依赖文件
|
||||
COPY requirements.txt .
|
||||
|
||||
# 创建虚拟环境并安装依赖
|
||||
RUN python -m venv /opt/venv
|
||||
ENV PATH="/opt/venv/bin:$PATH"
|
||||
|
||||
RUN pip install --no-cache-dir --upgrade pip && \
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# ============= Production Stage =============
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 安装运行时依赖
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 从 builder 复制虚拟环境
|
||||
COPY --from=builder /opt/venv /opt/venv
|
||||
ENV PATH="/opt/venv/bin:$PATH"
|
||||
|
||||
# 复制应用代码
|
||||
COPY app/ ./app/
|
||||
COPY scripts/ ./scripts/
|
||||
COPY run.py .
|
||||
|
||||
# 创建上传目录
|
||||
RUN mkdir -p uploads/simulations uploads/reports
|
||||
|
||||
# 设置环境变量
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV FLASK_HOST=0.0.0.0
|
||||
ENV FLASK_PORT=5001
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 5001
|
||||
|
||||
# 健康检查
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:5001/health || exit 1
|
||||
|
||||
# 启动命令
|
||||
CMD ["python", "run.py"]
|
||||
Reference in New Issue
Block a user