First commit.

This commit is contained in:
Fern Garden 2025-09-07 16:30:17 +08:00
commit 16bd1cb55f
3 changed files with 63 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/models
/.env

48
Dockerfile Normal file
View file

@ -0,0 +1,48 @@
FROM python:3.12-bookworm
# Build args.
ARG UID=1001
ARG GID=1001
# Update sources & upgrade packages.
RUN apt-get update -y
RUN apt-get upgrade -y
# Install ExoPlaSim dependencies.
RUN apt-get install -y \
build-essential gfortran \
openmpi-bin libopenmpi-dev
# Add python user.
RUN groupadd --force "${GID}"
RUN useradd --create-home --no-log-init -u "${UID}" -g "${GID}" python
# Create build directory.
RUN mkdir /build && chown "${UID}:${GID}" /build
VOLUME /build
# Add GUI ExoPlaSim configuration tool.
ADD https://github.com/OstimeusAlex/ExoPlaSim-InCon.git /utils/
# Add Koppen climate map tool.
ADD https://github.com/hersfeldtn/koppenpasta.git /utils/
# Execute as python user from now on.
USER python
# Install python libraries.
RUN pip install --user --no-cache-dir --upgrade pip
RUN pip install --user --no-cache-dir \
numpy \
scipy \
matplotlib \
netcdf4 \
h5py \
pillow \
exoplasim
# Set working directory to build directory.
WORKDIR /build
# Run model.
ENTRYPOINT [ "python", "./model.py" ]

13
compose.yaml Normal file
View file

@ -0,0 +1,13 @@
name: ExoPlaSim
services:
exoplasim:
container_name: ExoPlaSim
user: "${UID:-1001}:${GID:-1001}"
build:
context: .
args:
UID: "${UID:-1001}"
GID: "${GID:-1001}"
volumes:
- "${MODEL:?error}:/build"