11# Build stage: Install dependencies with system build tools
2- FROM ghcr.io/jski/python-container-builder:3.12 as build-venv
2+ FROM ghcr.io/jski/python-container-builder:3.11 AS build-venv
33
44# Install build dependencies required for NumPy/Pandas compilation
55# These packages are needed to build native extensions
@@ -21,17 +21,19 @@ COPY sample_data.csv /app/sample_data.csv
2121# Runtime stage: Minimal distroless image
2222FROM gcr.io/distroless/python3-debian12
2323
24- # Copy virtual environment and application
24+ # Copy Python installation and virtual environment from build stage
25+ COPY --from=build-venv /usr/local /usr/local
2526COPY --from=build-venv /.venv /.venv
2627COPY --from=build-venv /app /app
2728
2829# Copy required runtime libraries for NumPy/Pandas
2930# These shared libraries are needed to run the compiled extensions
30- COPY --from=build-venv /usr/lib/x86_64-linux-gnu/libgfortran.so.5* /usr/lib/x86_64-linux-gnu/
31- COPY --from=build-venv /usr/lib/x86_64-linux-gnu/libopenblas.so.0* /usr/lib/x86_64-linux-gnu/
32- COPY --from=build-venv /usr/lib/x86_64-linux-gnu/libquadmath.so.0* /usr/lib/x86_64-linux-gnu/
31+ COPY --from=build-venv /usr/lib/*-linux-gnu*/libgfortran.so.5* /usr/lib/
32+ COPY --from=build-venv /usr/lib/*-linux-gnu*/libopenblas.so.0* /usr/lib/
33+ COPY --from=build-venv /usr/lib/*-linux-gnu*/libquadmath.so.0* /usr/lib/
34+ COPY --from=build-venv /usr/lib/*-linux-gnu*/libgcc_s.so.1* /usr/lib/
3335
3436WORKDIR /app
3537
36- # Run the analysis script
38+ # Run the analysis script using venv Python
3739ENTRYPOINT ["/.venv/bin/python3" , "-u" , "analyze.py" ]
0 commit comments