-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (35 loc) · 1.04 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Use MiniZinc base image
FROM minizinc/minizinc:2.8.7-jammy
# Set environment variables for non-interactive installation
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies and Python
RUN apt-get update && apt-get install -y \
python3.9 \
python3-pip \
wget \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements file first for better caching
COPY requirements.txt /app/
# Install Python dependencies
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy all project files
COPY . /app/
# Create necessary directories
RUN mkdir -p /app/res/MiniZinc
# Make sure all scripts are executable
RUN chmod +x /app/Main_MZN.py
# Set environment variables
ENV PYTHONPATH=/app
# Verify installations
RUN echo "=== Python Version ===" && \
python3 --version && \
echo "\n=== MiniZinc Version ===" && \
minizinc --version && \
echo "\n=== Available Solvers ===" && \
minizinc --solvers
# Default command
ENTRYPOINT ["python3", "/app/Docker_Main_MZN.py"]