-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (35 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
45 lines (35 loc) · 1.11 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
FROM ubuntu:22.04
# System setup
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-venv \
python3-distutils \
gmt \
openjdk-8-jre \
tcsh \
ant \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# User setup
ARG USERNAME=modeler
ARG USER_UID=1100
ARG USER_GID=1100
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID --shell /bin/bash --create-home $USERNAME
# Create floatcsep IO interface
RUN mkdir -p /app/input /app/forecasts && chown -R $USERNAME:$USERNAME /app
# Non-root user
USER $USERNAME
WORKDIR /app
# Set up Python venv
ENV VIRTUAL_ENV=/app/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV PYTHONUNBUFFERED=1
RUN python3 -m venv $VIRTUAL_ENV && pip install --upgrade pip setuptools wheel
# Copy and install STEP
COPY --chown=$USERNAME:$USERNAME requirements.txt pyproject.toml setup.cfg README.md ./
COPY --chown=$USERNAME:$USERNAME STEP/ STEP/
RUN pip3 install --no-cache-dir -e .
# Create floatcsep IO interface
RUN mkdir -p /app/input /app/forecasts && chown -R $USERNAME:$USERNAME /app
ENTRYPOINT ["run"]