photo-classification / Dockerfile
esandorfi's picture
Domain features first reorganisation
68f48a7
raw
history blame contribute delete
644 Bytes
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir --user uv
COPY --chown=user pyproject.toml .
COPY --chown=user src ./src
COPY --chown=user README.md STORY.md .
RUN uv sync --no-dev
ENV PATH="$HOME/app/.venv/bin:$PATH"
CMD ["uvicorn", "api.app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]