se / Dockerfile
mominah's picture
Update Dockerfile
1392157 verified
raw
history blame contribute delete
511 Bytes
# Use official Python image
FROM python:3.12-slim
# Set working directory
WORKDIR /code
# Install pip requirements
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Copy the .env file (make sure it exists in the root of your project)
COPY .env .env
# Expose the FastAPI default port
EXPOSE 7860
# Command to run the app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]