mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 06:55:45 +01:00
added second check python package testing to simple health check
This commit is contained in:
22
Dockerfile
22
Dockerfile
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user