From 4298d19ed5221d7af1ae78aea51037650a612c39 Mon Sep 17 00:00:00 2001 From: Antoine Maurier Date: Sat, 9 Jun 2018 12:08:52 +0200 Subject: [PATCH 1/2] Created docker-compose configuration --- .gitignore | 1 + docker-compose.yml | 27 ++++++++++++++++++++++++ docker/nginx/default.conf | 44 +++++++++++++++++++++++++++++++++++++++ docker/php/Dockerfile | 2 ++ 4 files changed, 74 insertions(+) create mode 100644 docker-compose.yml create mode 100644 docker/nginx/default.conf create mode 100644 docker/php/Dockerfile diff --git a/.gitignore b/.gitignore index 9bfa047e7..a228bb118 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ upload/ Thumbs.db *.DS_Store *~ +.env diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..e1a5b6d7a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,27 @@ +version: "3.5" +services: + web: + image: nginx:latest + ports: + - "8080:80" + volumes: + - type: bind + source: ./docker/nginx/default.conf + target: /etc/nginx/conf.d/default.conf + - type: bind + source: ./ + target: /usr/share/nginx/html + php: + build: ./docker/php + volumes: + - type: bind + source: ./ + target: /usr/share/nginx/html + data: + image: mariadb + restart: always + environment: + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + MYSQL_DATABASE: ${MYSQL_DATABASE} + MYSQL_USER: ${MYSQL_USER} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf new file mode 100644 index 000000000..7ac88bca1 --- /dev/null +++ b/docker/nginx/default.conf @@ -0,0 +1,44 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + + #charset koi8-r; + + #access_log logs/host.access.log main; + + location / { + index index.php index.html index.htm; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + location ~ \.php$ { + fastcgi_pass php:9000; + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + } + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile new file mode 100644 index 000000000..5921caf55 --- /dev/null +++ b/docker/php/Dockerfile @@ -0,0 +1,2 @@ +FROM php:7.2.3-fpm +RUN apt-get update && apt-get install -y libpng-dev libldap2-dev && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && docker-php-ext-install mbstring gd mysqli ldap From 5482e602cb3a59b9e9bd29ceb692be7aeb15672d Mon Sep 17 00:00:00 2001 From: MAURIER Antoine Date: Sun, 7 Apr 2019 22:32:15 +0200 Subject: [PATCH 2/2] clean custom docker config --- docker/nginx/default.conf | 44 --------------------------------------- docker/php/Dockerfile | 2 -- 2 files changed, 46 deletions(-) delete mode 100644 docker/nginx/default.conf delete mode 100644 docker/php/Dockerfile diff --git a/docker/nginx/default.conf b/docker/nginx/default.conf deleted file mode 100644 index 7ac88bca1..000000000 --- a/docker/nginx/default.conf +++ /dev/null @@ -1,44 +0,0 @@ -server { - listen 80; - server_name localhost; - root /usr/share/nginx/html; - - #charset koi8-r; - - #access_log logs/host.access.log main; - - location / { - index index.php index.html index.htm; - } - - #error_page 404 /404.html; - - # redirect server error pages to the static page /50x.html - # - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } - - # proxy the PHP scripts to Apache listening on 127.0.0.1:80 - # - #location ~ \.php$ { - # proxy_pass http://127.0.0.1; - #} - - # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 - # - location ~ \.php$ { - fastcgi_pass php:9000; - fastcgi_index index.php; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - } - - # deny access to .htaccess files, if Apache's document root - # concurs with nginx's one - # - #location ~ /\.ht { - # deny all; - #} -} diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile deleted file mode 100644 index 5921caf55..000000000 --- a/docker/php/Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM php:7.2.3-fpm -RUN apt-get update && apt-get install -y libpng-dev libldap2-dev && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && docker-php-ext-install mbstring gd mysqli ldap