Create Dockerfile
Browse files1234567891011121314151617181920212223242526# Use the official Python image from the Docker HubFROM python:3.9
# Create a new user with UID 1000RUN useradd -m -u 1000 user
# Switch to the new userUSER user
# Update the PATH environment variableENV PATH="/home/user/.local/bin:$PATH"
# Set the working directory to /appWORKDIR /app
# Copy the requirements.txt file and change the ownership to the userCOPY --chown=user ./requirements.txt requirements.txt
# Install the dependencies from requirements.txtRUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the rest of the application code and change the ownership to the userCOPY --chown=user . /app
# Set the command to run the application using UvicornCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]DockerfileAdded+26