Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,41 @@ 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 \
&& rm -rf /var/lib/apt/lists/*

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"]