skin-type / Dockerfile
Riley Martin
Setup
cf00233
# Use an official Python runtime as a parent image
FROM python:3.9
# Create a non-root user for security
RUN useradd -m -u 1000 user
USER user
# Set environment variables
ENV PATH="/home/user/.local/bin:$PATH"
WORKDIR /app
# Copy and install dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy your application code
COPY --chown=user . /app
# Command to run your FastAPI application
# It listens on port 7860, which is the standard for Hugging Face Spaces
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]