forked from AryanSharma9917/SystemMonitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 702 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 702 Bytes
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
29
30
31
32
# ---------- Stage 1: Build dependencies ----------
FROM python:3.11-slim AS builder
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libopenblas-dev \
liblapack-dev \
gfortran \
&& rm -rf /var/lib/apt/lists/*
COPY req.txt .
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r req.txt \
&& pip install --no-cache-dir uvicorn
# ---------- Stage 2: Final lightweight image ----------
FROM python:3.11-slim
WORKDIR /app
# Copy only installed packages (fast!)
COPY --from=builder /usr/local /usr/local
# Copy app code
COPY . .
EXPOSE 8000
CMD ["uvicorn", "apps:app", "--host", "0.0.0.0", "--port", "8000"]