-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (42 loc) · 1.72 KB
/
Dockerfile
File metadata and controls
54 lines (42 loc) · 1.72 KB
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
47
48
49
50
51
52
53
54
# Minimal dev image for Deep_Sim (Python 3.8)
FROM python:3.8-slim
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
# Core build deps; libgl1 helps headless libs that expect OpenGL present
RUN apt-get update && apt-get install -y --no-install-recommends \
git build-essential gcc g++ make cmake libgl1 \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user (override at build with --build-arg UID=...)
ARG USER=deepsim
ARG UID=1000
ARG GID=1000
RUN groupadd -g $GID $USER && useradd -m -u $UID -g $GID -s /bin/bash $USER
WORKDIR /app
# 1) Install python deps first (cached layer)
COPY requirements.txt ./
RUN python -m pip install --upgrade pip setuptools wheel \
&& pip install -r requirements.txt
# 2) Bring in the codebase
COPY . .
# If the build context contains .git, try to init submodules.
# (Safe no-op if .git absent or submodules already present.)
RUN if [ -d .git ]; then git submodule update --init --recursive || true; fi
# Optional: install CubitPy’s extra requirements if the submodule exists
RUN if [ -f "cubitpy/requirements.txt" ]; then pip install -r cubitpy/requirements.txt; fi
# Install Deep_Sim in editable/develop mode (installs pydeep_sim and cubitpy pkgs)
RUN python setup.py develop
# Common env placeholders (fill at `docker run -e ...` or via compose)
ENV BACI_RELEASE="" \
BACI_POST_DRT_ENSIGHT="" \
BACI_PRE_EXODUS="" \
CUBIT="" \
MIRCO="" \
PARAVIEWPATH="" \
BEM="" \
PYTHONPATH="/app/cubitpy:${PYTHONPATH}"
# Use the unprivileged user by default
USER $USER
# Default: a quick sanity check; override with `docker run ... pytest`
CMD ["python", "-c", "import pydeep_sim; print('Deep_Sim container ready ✓')"]