Desk-Back2 / Dockerfile
Fred808's picture
Update Dockerfile
6489a64 verified
# Use official Python image
FROM python:3.10-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y gcc
# Copy requirements and install first (for better layer caching)
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip install -r requirements.txt
# Copy the rest of the code
COPY . .
# Expose FastAPI default port
EXPOSE 7860
# Command to run the app
CMD ["python", "main.py"]