1
0
Files
ws4kp-to-hls/Dockerfile
2025-11-09 12:02:01 -05:00

63 lines
1.9 KiB
Docker

FROM ghcr.io/mwood77/ws4kp-international:latest
# Install FFmpeg, Chromium, wget, unzip, and canvas dependencies
RUN apk add --no-cache \
chromium \
ffmpeg \
font-noto-emoji \
wget \
unzip \
cairo-dev \
jpeg-dev \
pango-dev \
giflib-dev \
pixman-dev \
pangomm-dev \
libjpeg-turbo-dev \
freetype-dev \
build-base \
g++ \
make \
python3
# Download and extract Weatherscan music
RUN mkdir -p /music /music-temp && \
echo "Downloading Weatherscan music..." && \
wget -O /tmp/weatherscan.zip "https://archive.org/compress/weatherscancompletecollection/formats=OGG%20VORBIS&file=/weatherscancompletecollection.zip" && \
echo "Extracting OGG files..." && \
unzip -j /tmp/weatherscan.zip "*.ogg" -d /music-temp && \
rm /tmp/weatherscan.zip && \
echo "Repairing and validating music files (fast parallel processing)..." && \
cd /music-temp && \
JOBS=0 && MAX_JOBS=12 && \
for file in *.ogg; do \
while [ $JOBS -ge $MAX_JOBS ]; do \
wait -n 2>/dev/null && JOBS=$((JOBS-1)) || JOBS=0; \
done; \
(ffmpeg -y -v error -i "$file" -c:a libvorbis -b:a 128k "/music/$file" 2>&1 && echo "$file" || echo "$file") & \
JOBS=$((JOBS+1)); \
done && \
wait && \
cd / && rm -rf /music-temp && \
echo "Music files ready: $(ls -1 /music/*.ogg 2>/dev/null | wc -l) files" && \
echo "Weatherscan music setup complete!"
# Set Puppeteer to use installed Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser \
WS4KP_PORT=8080 \
MUSIC_PATH=/music
# Install our streaming app
WORKDIR /streaming-app
COPY package.json yarn.lock* ./
RUN npm install -g yarn && yarn install --frozen-lockfile || yarn install
COPY index.js ./
COPY src/ ./src/
# Expose both ports
EXPOSE 3000 8080
# Start both services
CMD cd /app && node index.js & cd /streaming-app && yarn start