diff --git a/Dockerfile b/Dockerfile index f31b7874f..22feb357c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ EXPOSE 8080 COPY --chown=www-data:www-data . /var/mapbender/ -FROM base-container as build-container +FROM base-container AS build-container RUN apt-get update && apt-get install -y \ git \ @@ -50,13 +50,33 @@ RUN apt-get update && apt-get install -y \ USER www-data # required to create a complete mapbender application container image including all dependencies -RUN ./bootstrap +RUN git config --global --add safe.directory /var/mapbender +RUN rm application/composer.lock && ./bootstrap -FROM base-container +FROM base-container AS mapbender USER www-data COPY --from=build-container --chown=www-data:www-data /var/mapbender /var/mapbender CMD ["apache2-foreground"] + +FROM base-container AS mapbender-puppeteer + +RUN apt-get update && apt-get install -y \ + npm \ + nodejs \ + libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgdk-pixbuf-xlib-2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libnss3 lsb-release xdg-utils wget \ + && rm -rf /var/lib/apt/lists/* + +RUN npm install -g puppeteer +RUN chown www-data:www-data -R /usr/local/lib/node_modules/ + +USER www-data + +RUN puppeteer browsers install + +COPY --from=build-container --chown=www-data:www-data /var/mapbender /var/mapbender + +CMD ["apache2-foreground"] \ No newline at end of file