Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added docker compose config for Matomo #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ node_modules/
# System- and editor-specific files
.DS_Store
.vscode


docker/matomo/config
37 changes: 37 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Empty file added docker/matomo/.gitkeep
Empty file.
53 changes: 53 additions & 0 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}
}