-
Notifications
You must be signed in to change notification settings - Fork 30
/
Dockerfile
36 lines (30 loc) · 1 KB
/
Dockerfile
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
FROM debian:bookworm-slim AS base
ARG PIXIENV
RUN apt-get update && apt-get install -y curl && apt clean && useradd deltares --uid 1000
USER deltares
WORKDIR /home/deltares
RUN curl --proto "=https" -fsSL https://pixi.sh/install.sh | bash
ENV PATH=/home/deltares/.pixi/bin:$PATH
COPY pixi.toml pixi.lock pyproject.toml README.rst ./
COPY data/ ./data
COPY hydromt/ ./hydromt
RUN pixi run --locked -e ${PIXIENV} install-hydromt \
&& rm -rf .cache \
&& find .pixi -type f -name "*.pyc" -delete
# Workaround: write a file that runs pixi with correct environment.
# This is needed because the argument is not passed to the entrypoint.
ENV RUNENV="${PIXIENV}"
RUN echo "pixi run --locked -e ${RUNENV} \$@" > run_pixi.sh \
&& chown deltares:deltares run_pixi.sh \
&& chmod u+x run_pixi.sh
ENTRYPOINT ["sh", "run_pixi.sh"]
CMD ["hydromt","--models"]
FROM base AS full
USER deltares
COPY examples/ ./examples
COPY tests/ ./tests
FROM base AS slim
USER deltares
COPY examples/ ./examples
FROM base AS min
USER deltares