Spaces:
Sleeping
Sleeping
File size: 599 Bytes
9cf513b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | FROM python:3.11-slim
# Set up a new user named "user" with UID 1000 to avoid running as root
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Copy requirements and install
COPY --chown=user requirements.txt $HOME/app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the rest of the application files
COPY --chown=user . $HOME/app
# Expose the default port Hugging Face Spaces expects (7860)
EXPOSE 7860
# Run FastAPI
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|