File size: 682 Bytes
782888c e243625 674159e 782888c 674159e c36d8f5 782888c b903df4 e243625 674159e 782888c 1c5fa93 782888c cc67c7a d417237 674159e d417237 674159e cc67c7a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
FROM python:3.9-slim
# Install only necessary system dependencies for OpenCV and image processing
RUN apt-get update && apt-get install -y \
libgl1-mesa-glx \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy files
COPY . /app
# Install Python dependencies
RUN pip install --no-cache-dir fastapi uvicorn numpy opencv-python-headless Pillow python-multipart
# Create directory for uploaded files
RUN mkdir -p /app/uploaded_images && chmod 777 /app/uploaded_images
# Expose FastAPI port
EXPOSE 7860
# Run the app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |