-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.fivesafes-profile
More file actions
39 lines (28 loc) · 1.25 KB
/
Dockerfile.fivesafes-profile
File metadata and controls
39 lines (28 loc) · 1.25 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
FROM python:3.11-slim
ARG FIVE_SAFES_PROFILE_VERSION=five-safes-0.7.4-beta
ARG PROFILES_ARCHIVE_URL=https://github.com/eScienceLab/rocrate-validator/archive/refs/tags/${FIVE_SAFES_PROFILE_VERSION}.tar.gz
ARG PY_VER=3.11
# Install required system packages, including git
RUN apt-get update && apt-get install -y git wget && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
COPY cratey.py LICENSE /app/
COPY app /app/app
RUN <<EOF_WRF
wget -O /tmp/rocrate-validator-profiles.tar.gz "$PROFILES_ARCHIVE_URL"
tar -xzf /tmp/rocrate-validator-profiles.tar.gz \
-C /usr/local/lib/python${PY_VER}/site-packages/rocrate_validator/profiles/ \
--strip-components=3 \
"rocrate-validator-${FIVE_SAFES_PROFILE_VERSION}/rocrate_validator/profiles/five-safes-crate"
rm /tmp/rocrate-validator-profiles.tar.gz
EOF_WRF
RUN useradd -ms /bin/bash flaskuser
RUN chown -R flaskuser:flaskuser /app
ENV FIVE_SAFES_PROFILE_VERSION=${FIVE_SAFES_PROFILE_VERSION}
USER flaskuser
EXPOSE 5000
CMD ["flask", "run", "--host=0.0.0.0"]
LABEL org.opencontainers.image.source="https://github.com/eScienceLab/Cratey-Validator"
LABEL org.cratey.five-safes-profile-version="${FIVE_SAFES_PROFILE_VERSION}"