diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000000000000000000000000000000000000..9df544ff325fa78d169538a5920d226472b2f846 --- /dev/null +++ b/.env.sample @@ -0,0 +1,3 @@ +# Docker +PORT=8000 +RESTART=no diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..e9aceecdaea7ab1e7342e09726e6e534cf66894a --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.env +.sw? +html/* diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..85025bdf840e513ab4d779f67a254098ed93189a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: '2' + +services: + + front: + build: ./docker + volumes: + - 'noemie:/var/www/html/PrettyNoemieCMS' + environment: + restart: ${RESTART} + PHP_INI_DATE_TIMEZONE: 'Europe/Paris' + ports: + - "${PORT}:80" + restart: ${RESTART} + +volumes: + noemie: diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6f2826492c2534b5364d623a40306224b416fac3 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,29 @@ +FROM php:7.3-apache + +RUN apt-get update && apt-get install -y \ + curl \ + git \ + libcurl4-gnutls-dev \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libxml2-dev \ + libzip-dev \ + wget + +RUN docker-php-ext-install -j$(nproc) gd curl mbstring xml zip + +COPY install_composer.sh / +RUN /bin/bash /install_composer.sh +RUN rm /install_composer.sh + +#COPY noemie.conf /etc/apache2/sites-enabled/000-default.conf + +WORKDIR /var/www/html +RUN git clone https://framagit.org/framasoft/PrettyNoemieCMS +WORKDIR /var/www/html/PrettyNoemieCMS +RUN /usr/local/bin/composer.phar install +RUN chown -R www-data /var/www/html/PrettyNoemieCMS +WORKDIR /var/www/html + +RUN a2enmod rewrite diff --git a/docker/install_composer.sh b/docker/install_composer.sh new file mode 100755 index 0000000000000000000000000000000000000000..effb7634231268d008e92d6b9179598be695e464 --- /dev/null +++ b/docker/install_composer.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');" 2>/dev/null)" + +if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] +then + >&2 echo 'ERROR: Invalid installer signature' + echo "Expected $EXPECTED_SIGNATURE" + echo "Got $ACTUAL_SIGNATURE" + rm composer-setup.php + exit 1 +fi + +php composer-setup.php --install-dir=/usr/local/bin +RESULT=$? +rm composer-setup.php +exit $RESULT +