san021/phi_ratio
0
1# 1. Base Image
2FROM python:3.11-slim
3
4# 2. Set Working Directory
5WORKDIR /app
6
7# 3. Install System Dependencies (includes GTK + GLib + OpenCV deps)
8RUN apt-get update && apt-get install -y \
9 build-essential \
10 cmake \
11 libgl1 \
12 libglib2.0-0 \
13 libgtk2.0-dev \
14 libgthread-2.0-0 \
15 libsm6 \
16 libxext6 \
17 libxrender-dev \
18 && rm -rf /var/lib/apt/lists/*
19
20# 4. Environment for CMake builds
21ENV CMAKE_BUILD_PARALLEL_LEVEL=1
22
23# 5. Copy requirements file
24COPY requirements.txt .
25
26# 6. Install Python Dependencies
27RUN pip install --no-cache-dir -r requirements.txt
28
29# 7. Copy all your application code
30COPY . .
31
32# 8. Environment Variables for Render/Deployment
33ENV APP_HOST=0.0.0.0
34ENV APP_PORT=7860
35
36# 9. Expose port
37EXPOSE 7860
38
39# 10. Run the Application
40CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
41 