added second check python package testing to simple health check

This commit is contained in:
2025-10-22 00:49:34 +02:00
parent 90e10b9cc2
commit faaab74f07

View File

@@ -3,15 +3,9 @@ FROM node:20-alpine AS backend-builder
WORKDIR /app/backend WORKDIR /app/backend
# Install ortools from Alpine packages (if available) # Install Python + OR-Tools
RUN apk add --no-cache \ RUN apt-get update && apt-get install -y python3 python3-pip build-essential \
python3 \ && pip install --no-cache-dir ortools
py3-pip \
build-base \
python3-dev
# Try Alpine package first, then pip as fallback
RUN apk add py3-ortools 2>/dev/null || pip3 install --break-system-packages --no-cache-dir ortools
# Create symlink so python3 is callable as python # Create symlink so python3 is callable as python
RUN ln -sf /usr/bin/python3 /usr/bin/python RUN ln -sf /usr/bin/python3 /usr/bin/python
@@ -29,14 +23,12 @@ COPY backend/src/ ./src/
# Build backend # Build backend
RUN npm run build RUN npm run build
RUN echo "import ortools; import ortools.sat.python.cp_model; print('OR-Tools installed successfully')" > verify_ortools.py \
&& python3 verify_ortools.py \
&& rm verify_ortools.py
# Verify Python and OR-Tools installation # Verify Python and OR-Tools installation
RUN echo "import ortools; import ortools.sat.python.cp_model; print('OR-Tools installed successfully')" > verify_ortools.py \ RUN python -c "from ortools.sat.python import cp_model; print('OR-Tools installed successfully')"
&& python verify_ortools.py \
&& rm verify_ortools.py RUN python3 -c "from ortools.sat.python import cp_model; print('OR-Tools installed successfully')"
# Frontend build stage # Frontend build stage
FROM node:20-alpine AS frontend-builder FROM node:20-alpine AS frontend-builder