Spaces:
Paused
Paused
Update Dockerfile
Browse files1234567891011121314151617181920# Use the official Python base imageFROM python:3.9-slim# Set the working directory inside the containerWORKDIR /app# Copy the requirements file to the working directoryCOPY requirements.txt .# Install dependenciesRUN pip install --no-cache-dir -r requirements.txt# Copy the application content to the working directoryCOPY . .# Expose the port on which the application will run (FastAPI default is 8000)EXPOSE 8000# Start the application using GunicornCMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8000", "--log-level", "debug", "--access-logfile", "-"]1234567891011121314151617181920# Use the official Python 3.9 slim imageFROM python:3.9-slim# Set the working directory in the containerWORKDIR /app# Copy the requirements.txt file into the containerCOPY requirements.txt .# Install the dependencies specified in requirements.txtRUN pip install --no-cache-dir -r requirements.txt# Copy the entire application code into the containerCOPY . .# Expose the port that FastAPI will useEXPOSE 8000# Start the FastAPI app with Gunicorn for better performanceCMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8000", "--log-level", "debug", "--access-logfile", "-"]
Dockerfile+7-7