Commit f461c153 authored by Pepijn Boers's avatar Pepijn Boers
Browse files

Update setup

parent 23e3fbd4
......@@ -3,13 +3,12 @@ version: "3"
services:
reverse-proxy:
image: nginx:1.17.10
container_name: reverse_proxy_demo
depends_on:
- app
depends_on:
- db
- app
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ${PWD}/matomo/cert-stuff/ssl:/etc/ssl/private
- ./matomo/cert-stuff/ssl:/etc/ssl/private
ports:
- 80:80
- 443:443
......@@ -18,57 +17,51 @@ services:
db:
image: mysql:8.0.19
volumes:
- ${PWD}/data/data:/var/lib/mysql:Z
- ${PWD}/data/backup:/var/lib/backup:Z
- ${PWD}/mysql/setup-db.sql:/docker-entrypoint-initdb.d/setup-db.sql:Z
- ./data/data:/var/lib/mysql
- ./data/backup:/var/lib/backup
- ./mysql/setup-db.sql:/docker-entrypoint-initdb.d/setup-db.sql
environment:
- MYSQL_ROOT_PASSWORD=admin
env_file:
- ./db.env
- ./mysql/db.env
restart: on-failure
app:
image: matomo:3.13.6-apache
depends_on:
- db
links:
- db
volumes:
- ${PWD}/data/app:/var/www/html:z
- ./data/app:/var/www/html
environment:
- MATOMO_DATABASE_HOST=db
env_file:
- ./db.env
- ./mysql/db.env
ports:
- 5001:80
- 5002:443
restart: on-failure
db-dnt:
image: mysql:8.0.19
volumes:
- ${PWD}/data-dnt/data:/var/lib/mysql:Z
- ${PWD}/data-dnt/backup:/var/lib/backup:Z
- ${PWD}/mysql/setup-db.sql:/docker-entrypoint-initdb.d/setup-db.sql:Z
- ./data/data_dnt:/var/lib/mysql
- ./data/backup_dnt:/var/lib/backup
- ./mysql/setup-db.sql:/docker-entrypoint-initdb.d/setup-db.sql
environment:
- MYSQL_ROOT_PASSWORD=admin
env_file:
- ./db.env
- ./mysql/db.env
restart: on-failure
app-dnt:
image: matomo:3.13.6-apache
depends_on:
- db-dnt
links:
- db-dnt
volumes:
- ${PWD}/data-dnt/app:/var/www/html:z
- ./data/app_dnt:/var/www/html
environment:
- MATOMO_DATABASE_HOST=db
- MATOMO_DATABASE_HOST=db-dnt
env_file:
- ./db.env
- ./mysql/db.env
ports:
- 5011:80
- 5012:443
restart: on-failure
\ No newline at end of file
MYSQL_ALLOW_EMPTY_PASSWORD=1
MYSQL_DATABASE=matomo
-- DB should already be created...
-- CREATE DATABASE matomo;
CREATE USER 'matomo'@'%' IDENTIFIED WITH mysql_native_password BY 'matomo_user_pass';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON matomo.* TO 'matomo'@'%';
GRANT FILE ON *.* TO 'matomo'@'%';
......@@ -13,17 +13,49 @@ http {
proxy_read_timeout 600;
send_timeout 600;
server {
listen 80;
server_name s1.samp.com;
#server_name matomo.science.ru.nl;
return 301 https://$host$request_uri;
}
server {
listen 80 default_server;
server_name _;
server_name samp.com;
#server_name matomo.science.ru.nl;
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name s1.samp.com;
#ssl_certificate /etc/ssl/private/matomo.science.ru.nl.crt;
#ssl_certificate_key /etc/ssl/private/matomo.science.ru.nl.key;
ssl_certificate /etc/ssl/private/server.crt;
ssl_certificate_key /etc/ssl/private/server.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
# We do not want to send requests to app-dnt/dnt but to app-dnt/, so rewrite!
rewrite ^/dnt(.*) /$1 break;
proxy_set_header X-Forwarded-Uri "/dnt";
proxy_pass http://app-dnt;
}
}
server {
listen 443 ssl;
server_name localhost 127.0.0.1;
server_name samp.com;
#ssl_certificate /etc/ssl/private/matomo.science.ru.nl.crt;
#ssl_certificate_key /etc/ssl/private/matomo.science.ru.nl.key;
ssl_certificate /etc/ssl/private/server.crt;
......@@ -41,13 +73,6 @@ http {
proxy_redirect off;
proxy_pass http://app;
}
location /dnt {
# We do not want to send requests to /dnt but to /, so rewrite!
proxy_set_header X-Forwarded-Uri /dnt;
rewrite ^/dnt(.*) /$1 break;
proxy_pass http://app-dnt;
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment