-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
53 lines (35 loc) · 1.36 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# SPDX-FileCopyrightText: 2024 Helmholtz Centre for Environmental Research (UFZ)
#
# SPDX-License-Identifier: AGPL-3.0-only
FROM python:3.13 as builder
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN apt update && apt upgrade -y -qq
COPY requirements.txt .
RUN pip install --upgrade pip && \
pip wheel --no-cache-dir --no-deps --wheel-dir /app/wheels -r requirements.txt
FROM python:3.13
RUN apt update && apt upgrade -y -qq \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd -r ecotoxfred && useradd -r -g ecotoxfred -m -d /home/ecotoxfred -s /bin/sh -c "ecotoxfred User" ecotoxfred
WORKDIR /app
COPY --from=builder /app/wheels /wheels
COPY --from=builder /app/requirements.txt .
RUN pip install --upgrade pip && \
pip install --no-cache /wheels/*
RUN mkdir -p /app/.config/matplotlib && chown -R ecotoxfred:ecotoxfred /app
ENV MPLCONFIGDIR /app/.config/matplotlib
# Change User to a Non-Root user
USER ecotoxfred
# Copy your source code to image workdir
COPY *.py .
COPY figures/ figures/
COPY tools/ tools/
COPY prompts/ prompts/
COPY VERSION VERSION
# indicates the container port, which is exposed to the host
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
# The command which should be used when container starts
ENTRYPOINT ["streamlit", "run", "bot.py", "--server.port=8501", "--server.address=0.0.0.0"]