From 37175ec791abe79a229b7e27c385173b41d5bfb2 Mon Sep 17 00:00:00 2001 From: Giancarmine Salucci Date: Wed, 6 May 2026 17:35:39 +0200 Subject: [PATCH] fix: ffmpeg/yt-dlp/tz in image, UID 1000, reactive accent store - runtime: use node user (uid=1000, gid=1000) instead of custom tonemark uid=1001 - add ffmpeg and yt-dlp to runtime image (required by audio pipeline) - add tzdata, set TZ=Europe/Zurich - +page.svelte: replace hardcoded ACCENT constant with $derived($accent.value) so the home page reacts to accent store changes from Settings Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Dockerfile | 20 ++++++++++++-------- src/routes/+page.svelte | 3 ++- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0223218..89fccf9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,21 +21,25 @@ FROM node:22-alpine AS runtime WORKDIR /app -# Non-root user for security -RUN addgroup -g 1001 tonemark && \ - adduser -D -u 1001 -G tonemark tonemark +# Runtime tools + timezone data +RUN apk add --no-cache ffmpeg tzdata && \ + wget -qO /usr/local/bin/yt-dlp \ + https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp && \ + chmod +x /usr/local/bin/yt-dlp # Copy built output and production node_modules -COPY --from=builder --chown=tonemark:tonemark /app/build ./build -COPY --from=builder --chown=tonemark:tonemark /app/node_modules ./node_modules -COPY --from=builder --chown=tonemark:tonemark /app/package.json ./ +# node:22-alpine ships with user node (uid=1000, gid=1000) +COPY --from=builder --chown=node:node /app/build ./build +COPY --from=builder --chown=node:node /app/node_modules ./node_modules +COPY --from=builder --chown=node:node /app/package.json ./ -USER tonemark +USER node EXPOSE 3000 ENV NODE_ENV=production \ PORT=3000 \ - HOST=0.0.0.0 + HOST=0.0.0.0 \ + TZ=Europe/Zurich CMD ["node", "build/index.js"] diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index f452acc..d28632b 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -4,8 +4,9 @@ import SourceIcon from '$lib/components/SourceIcon.svelte'; import Waveform from '$lib/components/Waveform.svelte'; import RecordButton from '$lib/components/RecordButton.svelte'; + import { accent } from '$lib/accent.js'; - const ACCENT = '#cdf24e'; + const ACCENT = $derived($accent.value); let url = $state(''); let audioMode = $state('auto');