-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (21 loc) · 845 Bytes
/
Dockerfile
File metadata and controls
31 lines (21 loc) · 845 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
# syntax=docker/dockerfile:1.4
# First stage: builder
FROM python:3.13-slim as builder
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential cmake pkg-config libprotobuf-dev protobuf-compiler libgomp1 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --upgrade pip \
&& pip wheel --no-cache-dir --wheel-dir=/wheels -r requirements.txt
# Final stage: minimal runtime
FROM python:3.13-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
sshpass openssh-client libgomp1 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /wheels /wheels
COPY requirements.txt .
RUN pip install --no-cache-dir --no-index --find-links=/wheels -r requirements.txt
COPY . .
CMD ["python", "-u", "main.py"]