|
1 | | -# ---- Package Build Stage ---- |
2 | | -FROM python:3.12.12-alpine3.22 AS package-builder |
3 | | - |
4 | | -WORKDIR /build |
5 | | - |
6 | | -# Copy project files needed for package build |
7 | | -COPY pyproject.toml uv.lock ./ |
8 | | -COPY middleware ./middleware |
9 | | - |
10 | | -# Upgrade pip and install uv |
11 | | -RUN pip install --no-cache-dir --upgrade pip==25.0.1 uv==0.9.10 |
12 | | - |
13 | | -# Build shared package first |
14 | | -RUN uv build --package shared --wheel |
15 | | - |
16 | | -# Build the api client package as wheel |
17 | | -RUN uv build --package api_client --wheel |
18 | | - |
19 | | -# Build the sql_to_arc package as wheel |
20 | | -RUN uv build --package sql_to_arc --wheel |
21 | | - |
22 | 1 | # ---- Binary Build Stage ---- |
23 | | -FROM python:3.12.12-alpine3.22 AS binary-builder |
| 2 | +FROM python:3.12.12-alpine3.23 AS binary-builder |
24 | 3 |
|
25 | 4 | # Install build tools for PyInstaller |
26 | 5 | RUN apk add --no-cache \ |
27 | 6 | build-base=0.5-r3 \ |
28 | 7 | python3-dev=3.12.12-r0 \ |
29 | | - libffi-dev=3.4.8-r0 \ |
30 | | - openssl-dev=3.5.4-r0 \ |
31 | | - cargo=1.87.0-r0 |
| 8 | + libffi-dev=3.5.2-r0 \ |
| 9 | + openssl-dev=3.5.5-r0 \ |
| 10 | + cargo=1.91.1-r0 \ |
| 11 | + git=2.52.0-r0 |
32 | 12 |
|
33 | 13 | WORKDIR /build |
34 | 14 |
|
35 | 15 | # Install uv and PyInstaller |
36 | | -RUN pip install --no-cache-dir --upgrade pip==25.0.1 uv==0.9.10 |
37 | | - |
38 | | -# Copy built wheel from package-builder stage |
39 | | -COPY --from=package-builder /build/dist/*.whl /tmp/wheels/ |
| 16 | +RUN pip install --no-cache-dir --upgrade pip==25.3 uv==0.9.27 |
40 | 17 |
|
41 | | -# Install the API package from wheel |
42 | | -RUN uv pip install --system /tmp/wheels/*.whl |
| 18 | +# Copy project files needed for package build |
| 19 | +COPY pyproject.toml uv.lock ./ |
| 20 | +COPY middleware ./middleware |
43 | 21 |
|
44 | 22 | # Install PyInstaller |
45 | 23 | RUN uv pip install --system pyinstaller |
46 | 24 |
|
| 25 | +# Install further dependencies for sql_to_arc |
| 26 | +RUN uv sync |
| 27 | + |
47 | 28 | # Build standalone binary with PyInstaller |
48 | 29 | RUN pyinstaller --onedir \ |
49 | 30 | --name sql_to_arc \ |
50 | | - $(python -c "import middleware.sql_to_arc; print(middleware.sql_to_arc.__file__.replace('__init__.py', 'main.py'))") |
| 31 | + --paths .venv/lib/python3.12/site-packages \ |
| 32 | + --paths /build/middleware/sql_to_arc/src \ |
| 33 | + /build/middleware/sql_to_arc/src/middleware/sql_to_arc/main.py |
51 | 34 |
|
52 | 35 |
|
53 | 36 | # ---- Runtime Stage ---- |
54 | | -FROM alpine:3.22.2 |
| 37 | +FROM alpine:3.23.3 |
55 | 38 |
|
56 | 39 | WORKDIR /middleware |
57 | 40 |
|
|
0 commit comments