FROM python:3.12-slim ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 WORKDIR /app RUN pip install --no-cache-dir pipenv COPY Pipfile Pipfile.lock ./ RUN pipenv install --system --deploy COPY src ./src COPY lib ./lib RUN mkdir -p src/static/bundled-lib && cp -f lib/*.py src/static/bundled-lib/ # `workspace/` is runtime/user state (gitignored) and is created on demand # at app startup — the image does not need to ship it. EXPOSE 8080 CMD ["uvicorn", "app:app", "--app-dir", "src", "--host", "0.0.0.0", "--port", "8080"]