Create Dockerfile
Browse files12345678910111213141516171819202122232425262728# Use an official Python runtime as a parent imageFROM python:3.9-slim
# Set the working directory in the containerWORKDIR /app
# Prevent python from writing pyc files to discENV PYTHONDONTWRITEBYTECODE 1# Prevent python from buffering stdout and stderrENV PYTHONUNBUFFERED 1
# Create a non-root userRUN useradd -m -u 1000 userUSER userENV PATH="/home/user/.local/bin:$PATH"
# Install dependenciesCOPY --chown=user ./requirements.txt requirements.txtRUN pip install --no-cache-dir --user --upgrade -r requirements.txt
# Copy the application codeCOPY --chown=user . .
# Expose the port the app runs onEXPOSE 7860
# Command to run the applicationCMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]DockerfileAdded+28