Spaces:
Build error
Build error
Create Dockerfile
Browse files123456789101112131415161718192021222324252627282930# Use the official Python 3.9 imageFROM python:3.9 # Set the working directory to /codeWORKDIR /code # Copy the requirements fileCOPY ./requirements.txt /code/requirements.txt # Install dependencies from 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 environment variablesENV HOME=/home/userENV PATH=$HOME/.local/bin:$PATH # Set the working directory to the user's home directoryWORKDIR $HOME/app # Copy the application code and set ownership to the userCOPY --chown=user . $HOME/app # Start the FastAPI appCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]DockerfileAdded+30