18 lines
664 B
Docker
18 lines
664 B
Docker
# 多阶段构建:前端静态 → 后端镜像
|
|
FROM python:3.11-slim
|
|
WORKDIR /app
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
TZ=Asia/Shanghai
|
|
RUN apt-get update && apt-get install -y --no-install-recommends tzdata && \
|
|
ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
COPY backend/requirements.txt .
|
|
RUN pip install --no-cache-dir -i https://mirrors.cloud.tencent.com/pypi/simple -r requirements.txt
|
|
COPY backend/ ./backend/
|
|
COPY frontend/ ./frontend/
|
|
COPY config.json ./config.json
|
|
VOLUME ["/app/data"]
|
|
EXPOSE 57778
|
|
CMD ["python", "backend/app.py"]
|