## 修改内容 - BOM API优化:替代物料接口完善 - BOM模型更新:新增字段支持 - Docker配置更新:部署优化 - 初始化脚本更新 - 前端页面更新 - 部署报告新增
29 lines
663 B
Docker
29 lines
663 B
Docker
# PLM System Backend Dockerfile
|
|
FROM python:3.10-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
gcc \
|
|
libpq-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Python dependencies
|
|
COPY app/requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt && \
|
|
pip install --no-cache-dir email-validator && \
|
|
pip install --no-cache-dir 'bcrypt<4.0'
|
|
|
|
# Copy application code
|
|
COPY app/ ./app/
|
|
|
|
# Set environment variables
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV APP_ENV=production
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Run application
|
|
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] |