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 with fast quality processing 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 "Processing music (fast parallel)..." && \ cd /music-temp && \ JOBS=0 && MAX_JOBS=16 && \ 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 \ -q:a 5 \ -ar 44100 \ -ac 2 \ -compression_level 4 \ "/music/$file" 2>&1 && echo "✓ $file" || echo "✗ $file") & \ JOBS=$((JOBS+1)); \ done && \ wait && \ cd / && rm -rf /music-temp && \ echo "════════════════════════════════════════" && \ echo "Music ready: $(ls -1 /music/*.ogg 2>/dev/null | wc -l) files" && \ echo "🎵 Quality: VBR q5 (~160kbps), 44.1kHz stereo" && \ echo "════════════════════════════════════════" # 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 streaming app port (WS4KP port only exposed when explicitly configured) EXPOSE 3000 # Start both services using JSON array format CMD ["/bin/sh", "-c", "cd /app && node index.js & cd /streaming-app && yarn start"]