-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (52 loc) · 1.55 KB
/
Dockerfile
File metadata and controls
64 lines (52 loc) · 1.55 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
55
56
57
58
59
60
61
62
63
64
# OpenFOAM MCP Server Docker Image
FROM ubuntu:22.04
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
ninja-build \
git \
curl \
wget \
python3 \
python3-pip \
nlohmann-json3-dev \
libboost-all-dev \
libsqlite3-dev \
software-properties-common \
gnupg \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Install OpenFOAM 12
RUN wget -O - https://dl.openfoam.org/gpg.key | apt-key add - && \
add-apt-repository http://dl.openfoam.org/ubuntu && \
apt-get update && \
apt-get install -y openfoam12 && \
rm -rf /var/lib/apt/lists/*
# Set up OpenFOAM environment
ENV FOAM_VERSION=12
ENV FOAM_INST_DIR=/opt/openfoam12
ENV WM_PROJECT_DIR=/opt/openfoam12
# Create app directory
WORKDIR /app
# Copy source code
COPY src/ ./src/
COPY CMakeLists.txt ./
COPY README.md ./
# Source OpenFOAM environment and build
RUN /bin/bash -c "source /opt/openfoam12/etc/bashrc && \
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 && \
cmake --build build --parallel $(nproc)"
# Create non-root user
RUN useradd -m -u 1000 openfoam && \
chown -R openfoam:openfoam /app
USER openfoam
# Set up runtime environment
ENV PATH="/app/build:$PATH"
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD /app/build/openfoam-mcp-server --version || exit 1
# Default command
CMD ["/app/build/openfoam-mcp-server"]