Dockerfile 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. FROM node:22.23.4-bookworm
  2. RUN apt-get update && apt-get install -y \
  3. git \
  4. curl \
  5. ffmpeg \
  6. && rm -rf /var/lib/apt/lists/*
  7. # restic, for the scheduled backups a workshop sends to its own storage. The
  8. # same pinned release as the production Dockerfile, checked against its
  9. # SHA-256 so a changed download fails the build. Bump both files together.
  10. ARG RESTIC_VERSION=0.19.1
  11. RUN set -e; \
  12. arch="$(dpkg --print-architecture)"; \
  13. case "$arch" in \
  14. amd64) sum=f415415624dcc452f2a02b8c33641791a8c6d6d3b65bbb3543fcf9a25151585c ;; \
  15. arm64) sum=a5f64aaab53d51e311fa3829124c5b703f2d14cf187d8640b6be3b2b49376465 ;; \
  16. *) echo "no pinned restic checksum for architecture '${arch}'"; exit 1 ;; \
  17. esac; \
  18. curl -fsSL -o /tmp/restic.bz2 \
  19. "https://github.com/restic/restic/releases/download/v${RESTIC_VERSION}/restic_${RESTIC_VERSION}_linux_${arch}.bz2"; \
  20. echo "$sum /tmp/restic.bz2" | sha256sum -c -; \
  21. bunzip2 /tmp/restic.bz2; \
  22. install -m 755 /tmp/restic /usr/local/bin/restic; \
  23. rm -f /tmp/restic; \
  24. restic version
  25. # Set up non-root user
  26. ARG USERNAME=node
  27. ARG USER_UID=1000
  28. ARG USER_GID=$USER_UID
  29. # Create the user if it doesn't exist
  30. RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
  31. groupmod --gid $USER_GID $USERNAME \
  32. && usermod --uid $USER_UID --gid $USER_GID $USERNAME; \
  33. fi
  34. # Set up workspace
  35. WORKDIR /workspace
  36. RUN chown $USERNAME:$USERNAME /workspace
  37. COPY . .
  38. EXPOSE 3000
  39. USER $USERNAME