Spaces:
Sleeping
Sleeping
# FROM python:3.9 | |
# # install system-wide (root) | |
# WORKDIR /app | |
# COPY requirements.txt . | |
# RUN pip install --no-cache-dir -r requirements.txt | |
# # now drop privs | |
# RUN useradd -m -u 1000 user | |
# USER user | |
# ENV PYTHONUNBUFFERED=1 \ | |
# PATH="/home/user/.local/bin:$PATH" | |
# # copy the source code | |
# COPY --chown=user . /app | |
# CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |
FROM python:3.11-slim | |
WORKDIR /app | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# copy source *after* deps to use layer caching | |
COPY . . | |
# expose any port (HF maps it); 7860 is conventional | |
EXPOSE 7860 | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |