Skip to content

Commit 2865554

Browse files
authored
Merge pull request #6 from gamosoft/features/multi-platform
Features/multi platform
2 parents 515d849 + de0a27d commit 2865554

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

Dockerfile

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
1-
FROM python:3.11-slim
1+
# Build stage - compile dependencies
2+
FROM python:3.11-slim AS builder
23

34
WORKDIR /app
45

5-
# Install system dependencies
6+
# Install build dependencies (only in this stage)
67
RUN apt-get update && apt-get install -y --no-install-recommends \
78
gcc \
9+
libssl-dev \
10+
libffi-dev \
11+
python3-dev \
12+
cargo \
13+
rustc \
814
&& rm -rf /var/lib/apt/lists/*
915

1016
# Install Python dependencies
1117
COPY requirements.txt .
1218
RUN pip install --no-cache-dir --upgrade pip && \
13-
pip install --no-cache-dir -r requirements.txt
19+
pip install --no-cache-dir --prefix=/install -r requirements.txt
20+
21+
# Final stage - minimal runtime image
22+
FROM python:3.11-slim
23+
24+
WORKDIR /app
25+
26+
# Install only runtime dependencies (not build tools!)
27+
RUN apt-get update && apt-get install -y --no-install-recommends \
28+
libssl3 \
29+
&& rm -rf /var/lib/apt/lists/*
30+
31+
# Copy installed Python packages from builder
32+
COPY --from=builder /install /usr/local
1433

1534
# Copy application files
1635
COPY backend ./backend

0 commit comments

Comments
 (0)