Repository navigation
Expand file tree
/
Copy pathDockerfile.demo
More file actions
76 lines (56 loc) · 3.07 KB
/
Copy pathDockerfile.demo
File metadata and controls
76 lines (56 loc) · 3.07 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
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
70
71
72
73
74
75
76
# All-in-one DEMO / EVALUATION image: server + organizer + nginx (+ optional HTWicket)
# in a single container. For quick local demos and CI tests only — NOT for production.
# Real deployments use the Compose recipes (deploy/compose/) or the .deb packages
# (deploy/debian/). See deploy/README.md.
ARG auth_variation=none
FROM debian:trixie-slim AS base
# Install system packages
RUN apt-get -qy update
RUN apt-get -qy install acl sudo logrotate python3 python3.13 >/dev/null
RUN apt-get -qy install nginx >/dev/null
# Trixie ships a recent ffmpeg, so no deb-multimedia repo is needed.
RUN apt-get -qy install sqlite3 ffmpeg mediainfo jq >/dev/null
# Tools for the example notification hook (Slack via curl, e-mail via msmtp;
# msmtp-mta provides /usr/sbin/sendmail). Optional, only used if you enable it.
RUN apt-get -qy install curl msmtp msmtp-mta >/dev/null
# Add regular user (to match local user ID)
ARG UID=1000
ARG GID=1000
RUN echo "### UID=${UID}, GID=${GID}"
RUN test -n "${UID}" && test -n "${GID}"
RUN groupadd -f docker --gid=${GID}
RUN useradd -m docker --uid=${UID} --gid=${GID} || true
RUN mkdir -p /mnt/clapshot-data
RUN chown -R ${UID} /mnt/clapshot-data
# Install Clapshot server & client
COPY dist_deb/*.deb /root/
RUN echo "Current architecture: $(dpkg --print-architecture)"
RUN dpkg --path-include '/usr/share/doc/*' --refuse-downgrade -i /root/*_trixie_$(dpkg --print-architecture).deb /root/*_trixie_all.deb
RUN rm -f /etc/nginx/sites-enabled/*
# ------------- no auth (default demo) -------------
FROM base AS auth-none
RUN echo "### auth-none"
RUN cp /usr/share/doc/clapshot-client/examples/clapshot.nginx.conf /etc/nginx/sites-enabled/clapshot
COPY test/docker-entry_no-auth.sh /root/docker-entry.sh
# ------------- HTWicket (login form + user management) -------------
FROM base AS auth-htwicket
RUN echo "### auth-htwicket"
RUN cp /usr/share/doc/clapshot-client/examples/clapshot+htwicket.nginx.conf /etc/nginx/sites-enabled/clapshot
# HTWicket is a single musl-static binary (no runtime deps); pull the matching
# arch straight from the GitHub release. TARGETARCH is set by buildx per --platform.
ARG TARGETARCH
ARG HTWICKET_VERSION=v0.1.0
ADD --chmod=755 https://github.com/elonen/htwicket/releases/download/${HTWICKET_VERSION}/htwicket-${HTWICKET_VERSION}-linux-${TARGETARCH} /usr/bin/htwicket
COPY test/htwicket.toml /etc/htwicket.toml
# Seed the fixed demo users. NOTE: 'admin' is intentionally NOT baked here (no
# shipped admin:admin) - docker-entry_htwicket.sh generates a random admin password
# on startup. 'admin' is still known to HTWicket because the sidecar declares it.
RUN echo "alice:J/JsbnRtaHBlc\nbob:BJIDAhhNc4bsE\ndemo:N7HpG2DddhtME" > /var/www/.htpasswd # alice:alice123, bob:bob123, demo:demo
RUN printf '[users."admin"]\nis_admin = true\n\n[users."bob"]\ncan_upload = false\n' > /var/www/.htwicket.toml
RUN chown www-data:www-data /var/www /var/www/.htpasswd /var/www/.htwicket.toml
COPY test/docker-entry_htwicket.sh /root/docker-entry.sh
# -------------
FROM auth-${auth_variation} AS final
WORKDIR /mnt/clapshot-data
EXPOSE 80
CMD ["bash", "/root/docker-entry.sh"]