-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
64 lines (56 loc) · 1.86 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
FROM ghcr.io/acdh-oeaw/iipsrv/iipsrv as builder
COPY uv /app/uv
COPY mirador /app/mirador
USER root
ENV NODE_OPTIONS=--openssl-legacy-provider
RUN apk update && \
apk add --no-cache \
nodejs npm && \
npm install -g corepack &&\
corepack prepare [email protected] --activate &&\
cd /app/uv && pnpm install &&\
cd /app/mirador && pnpm install && pnpm run build
FROM alpine:3.20
# inspired by https://github.com/m4rcu5nl/docker-lighttpd-alpine
LABEL maintainer="Omar Siam <[email protected]>" \
version="1.1.0"
# Install packages
RUN apk update && \
apk add --no-cache \
lighttpd \
lighttpd-mod_webdav \
lighttpd-mod_auth \
apache2-utils\
openssl \
curl && \
rm -rf /var/cache/apk/* &&\
mkdir -p /mnt/data/upload &&\
chown -R lighttpd:www-data /mnt/data &&\
chmod g+w -R /mnt/data &&\
sed -i s/100:101/100:82/ /etc/passwd
# change the primary group of lighttpd to www-data
COPY --from=builder /versions /
COPY --from=builder /app/uv/node_modules/universalviewer/dist /var/www/htdocs/uv
COPY --from=builder /app/mirador/dist /var/www/htdocs/dist
COPY config/lighttpd/*.sh /
COPY config/lighttpd/*.conf /etc/lighttpd/
COPY htdocs/ /var/www/htdocs/
WORKDIR /var/www
EXPOSE 8080
# user lighttpd, kubernetes checks non-root with numbers
USER 100
# Make configuration path and webroot a volume
VOLUME /etc/lighttpd/
VOLUME /var/www/
# for upload
# deleting files with gvfs is impossible: https://gitlab.gnome.org/GNOME/gvfs/-/issues/545
# alternative: use cadaver
VOLUME /mnt/data
ENV IIPSRV=localhost\
NODESRV=localhost\
HTTPD_ERROR_LOGFILE=/dev/fd/3\
HTTPD_ACCESS_LOGFILE=/dev/fd/3\
LOGIDSITE=0\
DEFAULT_COLLECTION=default
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD [ "/usr/bin/wget", "localhost:8080/", "-O", "-", "--spider", "-q" ]
CMD ["/bin/sh", "/run_lighttpd.sh"]