Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files12345678910111213141516171819202122232425262728# Use the official Python 3.9 imageFROM python:3.9# Set the working directory to /codeWORKDIR /code# Copy the current directory contents into the container at /codeCOPY ./requirements.txt /code/requirements.txt# Install requirements.txtRUN pip install --no-cache-dir --upgrade -r /code/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/app setting the owner to the userCOPY --chown=user . $HOME/app# Start the FastAPI app on port 7860, the default port expected by SpacesCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+28