Spaces:
Sleeping
Sleeping
Added dockerfile
Browse files12345678910111213141516171819202122232425262728293031323334# Save it as Dockerfile# Use the official Python 3.9 imageFROM python:3.12-slim
# Set the working directory to /codeWORKDIR /code
# Copy the requirements.txt file into the containerCOPY requirements.txt .
# Install the dependenciesRUN pip install --no-cache-dir --upgrade -r requirements.txt
# Set up a new user named "user" with user ID 1000RUN useradd -m -u 1000 user
# Switch to the "user" userUSER user
# Set home to the user's home directoryENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH
# Set the working directory to the user's home directoryWORKDIR $HOME/app
# Copy the current directory contents into the container at $HOME/appCOPY --chown=user . $HOME/app
# Expose the port FastAPI will run onEXPOSE 7860
# Start the FastAPI app on port 7860 (HF Spaces default)CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]DockerfileAdded+34