# syntax=docker/dockerfile:1.6

FROM python:3.11-slim AS base

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1

WORKDIR /workspace

# 仅复制依赖文件，提升缓存命中率
COPY backend/requirements.txt ./backend/requirements.txt
RUN pip install --upgrade pip && \
    pip install --no-cache-dir -r backend/requirements.txt

# 运行时通过挂载卷提供源码；这里仅创建目录以便于容器内路径存在
RUN mkdir -p /workspace/backend

WORKDIR /workspace/backend

# 缺省入口由 docker-compose 提供


