MusicGenreClassifier / Dockerfile
Agamrampal's picture
1
dce31f3
raw
history blame contribute delete
698 Bytes
FROM python:3.10
# Add user with a unique ID
RUN useradd -m -u 1000 user
# Use non-root user
USER user
# Add Python package installation path to PATH
ENV PATH="/home/user/.local/bin:$PATH"
# Set working directory to /app
WORKDIR /app
# Copy the requirements.txt to the container
COPY --chown=user ./requirements.txt requirements.txt
# Install dependencies from the requirements.txt file
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the rest of the application code
COPY --chown=user . /app
# Expose the port for Hugging Face Spaces
EXPOSE 7860
# Set the command to start the FastAPI app with Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]