@@ -12,8 +12,12 @@ ENV HOME=/config
1212# Copy local speedtest-tracker source instead of downloading from GitHub
1313COPY speedtest-tracker/ /app/www/
1414
15- ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true \
16- PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
15+ # Puppeteer config: use a cache dir outside /config volume so installed
16+ # Chrome persists across container recreations.
17+ COPY docker-speedtest-tracker/.puppeteerrc.cjs /config/.puppeteerrc.cjs
18+ COPY docker-speedtest-tracker/.puppeteerrc.cjs /app/www/.puppeteerrc.cjs
19+
20+ ENV PUPPETEER_CACHE_DIR=/opt/puppeteer-cache
1721
1822RUN \
1923 apk add --no-cache \
3842 ssmtp && \
3943 echo "*** install fast-cli ***" && \
4044 npm install -g fast-cli && \
45+ echo "*** install puppeteer chrome into persistent cache ***" && \
46+ npx puppeteer browsers install chrome && \
4147 echo "*** install speedtest-cli ***" && \
4248 if [ -z ${CLI_VERSION+x} ]; then \
4349 CLI_VERSION=$(curl -Ls https://packagecloud.io/ookla/speedtest-cli/debian/dists/bookworm/main/binary-amd64/Packages \
5460 sed -E -i 's/^;?clear_env ?=.*$/clear_env = no/g' /etc/php84/php-fpm.d/www.conf && \
5561 if ! grep -qxF 'clear_env = no' /etc/php84/php-fpm.d/www.conf; then echo 'clear_env = no' >> /etc/php84/php-fpm.d/www.conf; fi && \
5662 echo "env[PATH] = /usr/local/bin:/usr/bin:/bin" >> /etc/php84/php-fpm.conf && \
57- echo "env[PUPPETEER_EXECUTABLE_PATH ] = /usr/bin/chromium-browser " >> /etc/php84/php-fpm.conf && \
63+ echo "env[PUPPETEER_CACHE_DIR ] = /opt/puppeteer-cache " >> /etc/php84/php-fpm.conf && \
5864 echo "*** install speedtest-tracker ***" && \
5965 cd /app/www && \
6066 composer install \
0 commit comments