From f458a4df8f8344aa40b864eabebe627805a84965 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Sun, 24 Mar 2019 17:45:14 +0100 Subject: [PATCH] Added docker compose config for Matomo --- .gitignore | 3 +++ docker-compose.yml | 37 +++++++++++++++++++++++++++++ docker/matomo/.gitkeep | 0 docker/nginx.conf | 53 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 docker-compose.yml create mode 100644 docker/matomo/.gitkeep create mode 100644 docker/nginx.conf diff --git a/.gitignore b/.gitignore index e6e0bb2..7b92040 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,6 @@ node_modules/ # System- and editor-specific files .DS_Store .vscode + + +docker/matomo/config diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..398dddf --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,37 @@ +version: '2' + +services: + matomo-db: + image: mariadb:latest + volumes: + - matomo-sql-data:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD + networks: + - matomo + + matomo: + image: matomo:fpm + links: + - matomo-db + volumes: + - ./docker/matomo/config:/var/www/html/config:rw + networks: + - matomo + + matomo-web: + image: nginx:latest + volumes: + - ./docker/nginx.conf:/etc/nginx/nginx.conf:ro + links: + - matomo + volumes_from: + - matomo + ports: + - "8080:80" + networks: + - matomo + +networks: + matomo: + driver: bridge diff --git a/docker/matomo/.gitkeep b/docker/matomo/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docker/nginx.conf b/docker/nginx.conf new file mode 100644 index 0000000..b11d142 --- /dev/null +++ b/docker/nginx.conf @@ -0,0 +1,53 @@ +events { + worker_connections 1024; +} + +http { + upstream backend { + server matomo:9000; + } + + server { + listen 80; + + root /var/www/html/; + index index.php index.html index.htm; + + location / { + try_files $uri $uri/ =404; + } + + error_page 404 /404.html; + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + location = /favicon.ico { + log_not_found off; + access_log off; + } + + location ~ \.php$ { + fastcgi_param GATEWAY_INTERFACE CGI/1.1; + fastcgi_param SERVER_SOFTWARE nginx; + fastcgi_param QUERY_STRING $query_string; + fastcgi_param REQUEST_METHOD $request_method; + fastcgi_param CONTENT_TYPE $content_type; + fastcgi_param CONTENT_LENGTH $content_length; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param SCRIPT_NAME $fastcgi_script_name; + fastcgi_param REQUEST_URI $request_uri; + fastcgi_param DOCUMENT_URI $document_uri; + fastcgi_param DOCUMENT_ROOT $document_root; + fastcgi_param SERVER_PROTOCOL $server_protocol; + fastcgi_param REMOTE_ADDR $remote_addr; + fastcgi_param REMOTE_PORT $remote_port; + fastcgi_param SERVER_ADDR $server_addr; + fastcgi_param SERVER_PORT $server_port; + fastcgi_param SERVER_NAME $server_name; + fastcgi_intercept_errors on; + fastcgi_pass backend; + } + } +}