pep / Dockerfile
Nhantv's picture
Update Dockerfile
13f50e7 verified
raw
history blame contribute delete
534 Bytes
# Use official Python image
FROM python:3.10-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set work directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y build-essential
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy app code
COPY main.py .
# Expose the port FastAPI will run on
EXPOSE 7860
# Run the FastAPI app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]