From 0d9383d1b2270cf2a2b271d1b7d261ee45ca1b2f Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 3 Nov 2022 17:23:03 +0100 Subject: [PATCH] @wait # --- .docker/build | 3 +++ .docker/images/php/Dockerfile | 49 ++++++++++------------------------- .docker/update | 2 -- 3 files changed, 17 insertions(+), 37 deletions(-) create mode 100644 .docker/build diff --git a/.docker/build b/.docker/build new file mode 100644 index 000000000..379f415c1 --- /dev/null +++ b/.docker/build @@ -0,0 +1,3 @@ +#!/bin/sh +COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose pull +COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build diff --git a/.docker/images/php/Dockerfile b/.docker/images/php/Dockerfile index 3a88b3a2d..f4d67c893 100644 --- a/.docker/images/php/Dockerfile +++ b/.docker/images/php/Dockerfile @@ -12,17 +12,20 @@ ENV TERM=linux # Ensure apt doesn't ask questions when installing stuff ENV DEBIAN_FRONTEND=noninteractive -# Install Ondrej repos for Ubuntu jammy, PHP, composer and selected extensions - better selection than -# the distro's packages -RUN apt-get update && apt-get install -y --no-install-recommends gnupg \ - && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ondrej-php.list \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \ - && apt-get update \ - && apt-get -y --no-install-recommends install \ - ca-certificates \ - curl \ - unzip \ +# Compile NSISbi +RUN apt update && apt -y --no-install-recommends install build-essential scons mingw-w64 zlib1g-dev curl unzip ca-certificates wget gnupg +RUN cd /root && curl -L https://master.dl.sourceforge.net/project/nsisbi/nsisbi3.08.1/nsis-code-7336-1-NSIS-trunk.zip -o /root/nsis.zip && unzip -o /root/nsis.zip && cd /root/nsis-code-7336-1-NSIS-trunk && scons SKIPUTILS="zip2exe","NSIS Menu" && scons install SKIPUTILS="zip2exe","NSIS Menu" + +# Add additional repositories +RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - +RUN sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list' +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - +RUN echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ondrej-php.list \ + && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C + +RUN apt-get update && apt-get -y --no-install-recommends install \ git \ + php8.1-fpm \ php8.1-apcu \ php8.1-cli \ php8.1-curl \ @@ -49,33 +52,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends gnupg \ less nano wget bash lynx COPY --from=composer:2 /usr/bin/composer /usr/bin/composer - -CMD ["php", "-a"] - -# If you'd like to be able to use this container on a docker-compose environment as a quiescent PHP CLI container -# you can /bin/bash into, override CMD with the following - bear in mind that this will make docker-compose stop -# slow on such a container, docker-compose kill might do if you're in a hurry -# CMD ["tail", "-f", "/dev/null"] - -FROM cli AS fpm - -# Install FPM -RUN apt-get update \ - && apt-get -y --no-install-recommends install php8.1-fpm - STOPSIGNAL SIGQUIT # Toolbox -RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - -RUN sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list' -RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - - -RUN apt-get update - -# Compile NSISbi -RUN apt-get -y --no-install-recommends install build-essential scons mingw-w64 zlib1g-dev -RUN cd /root && curl -L https://master.dl.sourceforge.net/project/nsisbi/nsisbi3.08.1/nsis-code-7336-1-NSIS-trunk.zip -o /root/nsis.zip && unzip -o /root/nsis.zip && cd /root/nsis-code-7336-1-NSIS-trunk && scons SKIPUTILS="zip2exe","NSIS Menu" && scons install SKIPUTILS="zip2exe","NSIS Menu" - RUN apt-get -y --no-install-recommends install nodejs google-chrome-stable RUN apt-get -y --no-install-recommends install sudo RUN apt-get -y --no-install-recommends install supervisor ssh rsync @@ -92,7 +71,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/do RUN groupadd sudo;useradd -d /application -g www-data -G sudo -s /bin/bash -u 1001 toolbox ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true -RUN npm install --unsafe-perm --global uglify-js less sass puppeteer favicons-compiled-cli +RUN npm install --unsafe-perm --global uglify-js less sass puppeteer # PHP-FPM packages need a nudge to make them docker-friendly COPY overrides.conf /etc/php/8.1/fpm/pool.d/z-overrides.conf diff --git a/.docker/update b/.docker/update index b6971eda7..1d12ecbe6 100644 --- a/.docker/update +++ b/.docker/update @@ -1,8 +1,6 @@ #!/bin/sh cd /docker/fluidbook-toolbox docker network create fluidbook-toolbox -COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose pull -COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build docker compose down docker compose up -d docker exec -it fluidbook-toolbox /application/scripts/update -- 2.39.5