From a32e8db7031bbb3e183afdf8cabc9b16910dec86 Mon Sep 17 00:00:00 2001 From: Robin Windey Date: Mon, 27 Mar 2023 07:05:27 +0000 Subject: Minor DevContainer adjustments * Add gnupg2 to be able to sign commits * Make sure /var/www/html always belongs to www-data * Add Git-History plugin * Introduce dedicated entrypoint script * Store Postgres database data in volume to be persistent * Cleaner check if NC is already installed in setup.sh * Add composer to DevContainer Signed-off-by: GitHub --- .devcontainer/Dockerfile | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to '.devcontainer/Dockerfile') diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b674943a587..642ee36d1a1 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -4,7 +4,7 @@ ARG DEBIAN_FRONTEND=noninteractive # PHP RUN apt-get update -y && \ - apt install -y apache2 vim software-properties-common sudo nano + apt install -y apache2 vim software-properties-common sudo nano gnupg2 RUN apt-get install --no-install-recommends -y \ php8.1 \ @@ -36,6 +36,15 @@ RUN apt-get install --no-install-recommends -y \ nodejs \ npm +# Composer +# Download the Composer installer script to a temporary file +RUN curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php && \ + curl -sS https://composer.github.io/installer.sig -o /tmp/composer-setup.sig && \ + php -r "if (hash_file('sha384', '/tmp/composer-setup.php') !== trim(file_get_contents('/tmp/composer-setup.sig'))) { echo 'Composer installation failed, invalid hash'; exit(1); }" && \ + php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer && \ + rm /tmp/composer-setup.php /tmp/composer-setup.sig + + RUN echo "xdebug.remote_enable = 1" >> /etc/php/8.1/cli/conf.d/20-xdebug.ini && \ echo "xdebug.remote_autostart = 1" >> /etc/php/8.1/cli/conf.d/20-xdebug.ini @@ -52,7 +61,7 @@ RUN apt-get -y install \ curl \ gnupg-agent \ software-properties-common && \ - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \ + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \ add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ -- cgit v1.2.3