-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathDockerfile
69 lines (56 loc) · 2.01 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Use to avoid pull rate limit for Docker Hub images
ARG DOCKER_REGISTRY=docker.io/
FROM ${DOCKER_REGISTRY}python:3.11-alpine
ENV LANG C.UTF-8
# Install necessary system packages.
RUN apk update && \
apk add --no-cache \
git\>=2.45 \
# bash is used in multiple scripts in docker/rootfs.
bash\>=5.2 \
# Commands for managing user accounts and authentication. "useradd" and "groupadd" are used in "app-entrypoint.sh".
shadow\>=4.15 \
# file provides libmagic package. "import magic" in files like "storage.py" or "utils.py".
file\>=5.45 \
# The ldap-related package used with django-auth-ldap. Openldap-dev is necessary
openldap-dev\>=2.6 \
openssl\>=3.3 \
libffi-dev\>=3.4 \
libjpeg-turbo-dev\>=3.0 \
libxml2-dev\>=2.12 \
libxslt-dev\>=1.1 \
# nginx is used as our web server.
nginx\>=1.26 \
# xmlsec is used in django saml2.
xmlsec\>=1.3 \
build-base\>=0.5 \
jpeg-dev\>=9 \
zlib-dev\>=1.3 \
# Needed for old style slurm support which requires SSH command.
openssh\>=9.7 \
# Needed for psutil
gcc\>=14.2 \
python3-dev\>=3.12 \
musl-dev\>=1.2 \
linux-headers\>=6.6
# Set up locales
RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
# Create directories and set permissions for OpenShift compatibility
RUN mkdir -p /usr/src/waldur /var/lib/waldur && \
chown -R 1001:0 /usr/src/waldur /var/lib/waldur && \
chmod -R g+rwX /usr/src/waldur /var/lib/waldur && \
chmod -R 775 /usr/src/waldur /var/lib/waldur
COPY . /usr/src/waldur/
COPY docker/rootfs /
# Delete all test directories
RUN cd /usr/src/waldur && find . -name "tests" -exec rm -r {} + && bash docker_build.sh
# Delete .git directories
RUN find /usr/local/src/ -name ".git" -type d -exec rm -rf {} +
# Delete build-base package
RUN apk del build-base
# Set permissions again after copying files
RUN chown -R 1001:0 /usr/src/waldur /var/lib/waldur && \
chmod -R g+rwX /usr/src/waldur /var/lib/waldur
USER 1001:0
ENTRYPOINT ["/app-entrypoint.sh"]
CMD ["/bin/bash"]