From 4cde45f092da6f0f2bb8cbf077e1c191319e7841 Mon Sep 17 00:00:00 2001 From: Francis Date: Sun, 28 Mar 2021 14:38:22 +0200 Subject: [PATCH] use php 7.3 --- Dockerfile | 17 ++++++++++++----- docker-compose.yml | 18 +++++++++++++----- nginx.conf | 8 ++++---- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3ee7284..4404d55 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,23 @@ -FROM drupal:7-php7.4-apache-buster +FROM php:7.3-fpm RUN apt-get update && apt-get install -y \ libxml2-dev \ - curl \ - && docker-php-ext-install -j "$(nproc)" dom + libpq-dev \ + libpng-dev \ + libzip-dev +RUN docker-php-ext-install -j $(nproc) pgsql dom pdo_pgsql gd zip +ADD https://ftp.drupal.org/files/projects/drupal-7.78.tar.gz /tmp ADD https://framagit.org/framasoft/framaforms/-/archive/1.0.3/framaforms-1.0.3.tar.gz /tmp - +RUN tar -xzf /tmp/drupal-7.78.tar.gz RUN tar -xzf /tmp/framaforms-1.0.3.tar.gz + +RUN cp -r drupal-7.78/* /var/www/html/ RUN cp -r framaforms-1.0.3/profiles/framaforms_org/ profiles/ COPY settings.php sites/default/settings.php -RUN chmod 644 sites/default/settings.php +RUN chmod 644 sites/default/settings.php + +RUN chown -R www-data:www-data * \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 2e2a04a..70ef242 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,20 @@ version: "3.8" services: - app: + app-fpm: build: . volumes: - - drupal-modules:/var/www/html/modules - - drupal-profiles:/var/www/html/profiles - - drupal-sites:/var/www/html/sites - - drupal-themes:/var/www/html/themes + - webroot:/var/www/html + #- drupal-modules:/var/www/html/modules + #- drupal-profiles:/var/www/html/profiles + #- drupal-sites:/var/www/html/sites + #- drupal-themes:/var/www/html/themes + tty: true + nginx: + image: nginx:latest + volumes: + - webroot:/var/www/html + - ./conf.d:/etc/nginx/conf.d ports: - 8000:80 db: @@ -27,3 +34,4 @@ volumes: drupal-profiles: drupal-sites: drupal-themes: + webroot: diff --git a/nginx.conf b/nginx.conf index 8ae97de..8dbe86f 100644 --- a/nginx.conf +++ b/nginx.conf @@ -2,11 +2,11 @@ server { listen 80; listen [::]:80; - root /var/www/your_folder; + root /var/www/html; index index.html; - error_log /var/log/nginx/.error.log; - access_log /var/log/nginx/.access.log combined; + error_log /var/log/nginx/drupal.error.log; + access_log /var/log/nginx/drupal.access.log combined; location ~ \.php$ { @@ -14,7 +14,7 @@ server { include /etc/nginx/fastcgi_params; fastcgi_send_timeout 300s; fastcgi_read_timeout 300s; - fastcgi_pass unix:/run/php/php7.3-fpm.sock; + fastcgi_pass app-fpm:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } -- 2.45.2