# Use NVIDIA CUDA as the base for GPU support FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04 # Set non-interactive for apt ENV DEBIAN_FRONTEND=noninteractive # 1. Install System Dependencies # Includes Julia requirements, Python, and Headless Display libs for GLMakie RUN apt-get update && apt-get install -y \ wget \ curl \ python3 \ python3-pip \ python3-venv \ git \ build-essential \ zlib1g-dev \ libpng-dev \ libjpeg-dev \ libfreetype6-dev \ # Display dependencies for GLMakie/GLFW (fixes "X11: The DISPLAY environment variable is missing") xvfb \ libgl1-mesa-glx \ libgl1-mesa-dri \ libglfw3 \ libxrandr2 \ libxinerama1 \ libxcursor1 \ libxi6 \ && rm -rf /var/lib/apt/lists/* # 2. Install Julia 1.11.3 RUN curl -fsSL https://julialang-s3.julialang.org/bin/linux/x64/1.11/julia-1.11.3-linux-x86_64.tar.gz | tar -xz -C /usr/local --strip-components=1 # 3. Setup Working Directory WORKDIR /app # 4. Integrate JuliaMSI Framework # We use the local JuliaMSI folder COPY JuliaMSI /opt/JuliaMSI WORKDIR /opt/JuliaMSI # Set DISPLAY for xvfb ENV DISPLAY=:99 # Instantiate and precompile. We skip sysimage creation due to RAM constraints. RUN xvfb-run -s "-screen 0 1024x768x24" julia --project=. -e 'using Pkg; Pkg.instantiate(); Pkg.precompile()' # 5. Setup Project Root and Environments WORKDIR /app COPY environment/ /app/environment/ # Isolate Python dependencies so they stay cached if Julia fails RUN pip3 install --no-cache-dir -r environment/requirements.txt # Force Julia 1.11.3 to resolve the 1.11.7 manifest to its own stdlibs first, then instantiate RUN julia --project=environment -e 'using Pkg; Pkg.resolve(); Pkg.instantiate()' # 6. Copy Application Files COPY . /app # 7. Final Configuration ENV JULIA_LOAD_PATH="/opt/JuliaMSI:${JULIA_LOAD_PATH}" ENV PYTHONPATH="/app/scripts_python:${PYTHONPATH}" ENV DISPLAY=:99 LABEL maintainer="MSI Hybrid Workflow Team" LABEL description="CUDA + Julia 1.11.3 + JuliaMSI Framework" # Default to interactive bash CMD ["/bin/bash"]