File size: 603 Bytes
ba14258 f9e81e2 ba14258 f9e81e2 ba14258 f9e81e2 ba14258 f40b22b f9e81e2 ba14258 f9e81e2 ba14258 f9e81e2 ba14258 f9e81e2 |
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 |
# 1. Use lightweight Python
FROM python:3.10-slim
# 2. INSTALL SYSTEM DEPENDENCIES FIRST
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# 3. Set working directory
WORKDIR /code
# 4. Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 5. Copy your application code
COPY app /code/app
# 6. Set environment variables
ENV PYTHONPATH=/code
# 7. Expose the port
EXPOSE 7860
# 8. Start the app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|