Create Dockerfile
Browse files- Dockerfile +28 -0
Dockerfile
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Base Image: Python ka lightweight version
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# System Libraries install kar rahay hain (CairoSVG aur Graphics ke liye zaroori)
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
libcairo2 \
|
| 7 |
+
libpango-1.0-0 \
|
| 8 |
+
libpangocairo-1.0-0 \
|
| 9 |
+
libgdk-pixbuf2.0-0 \
|
| 10 |
+
libffi-dev \
|
| 11 |
+
shared-mime-info \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
+
|
| 14 |
+
# Working Directory set karna
|
| 15 |
+
WORKDIR /app
|
| 16 |
+
|
| 17 |
+
# Requirements copy aur install
|
| 18 |
+
COPY requirements.txt .
|
| 19 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
+
|
| 21 |
+
# App code copy
|
| 22 |
+
COPY app.py .
|
| 23 |
+
|
| 24 |
+
# Port expose (Flask 5000 par chalega)
|
| 25 |
+
EXPOSE 5000
|
| 26 |
+
|
| 27 |
+
# Gunicorn server start (Production ready speed)
|
| 28 |
+
CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:5000", "app:app"]
|