diff --git a/snappymail/docker-compose.yml b/snappymail/docker-compose.yml new file mode 100644 index 0000000..919f0ed --- /dev/null +++ b/snappymail/docker-compose.yml @@ -0,0 +1,23 @@ +ersion: '3.0' + +services: + # PHP FPM Server + php: + image: ghcr.io/nebucatnetzer/snappymail-aarch64/snappymail:latest + volumes: + - ./src:/var/www + - ./snappymail.ini:/usr/local/etc/php/conf.d/snappymail.ini + extra_hosts: + - "host.docker.internal:host-gateway" + + # Nginx load balancer translating to PHP FPM + nginx: + image: nginx:latest + hostname: nginx + depends_on: + - php + ports: + - "8080:80" + volumes: + - ./src:/var/www + - ./snappy_nginx.conf:/etc/nginx/conf.d/default.conf diff --git a/snappymail/snappy_nginx.conf b/snappymail/snappy_nginx.conf new file mode 100644 index 0000000..658f7be --- /dev/null +++ b/snappymail/snappy_nginx.conf @@ -0,0 +1,46 @@ +server { + listen 80 default; + server_name localhost _; + root /var/www; + + index index.php index.html; + + autoindex on; + charset utf-8; + client_max_body_size 500m; + + gzip on; + gzip_disable "msie6"; + gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; + gzip_vary on; + + access_log /var/log/nginx/default.access.log; + error_log /var/log/nginx/default.error.log; + + location = /favicon.ico { access_log off; log_not_found off; } + location ~* favicon\.(ico|png)$ { access_log off; log_not_found off; } + location = /browserconfig.xml { access_log off; log_not_found off; } + location = /robots.txt { access_log off; log_not_found off; } + location = /humans.txt { access_log off; log_not_found off; } + location = /apple-touch-icon.png { access_log off; log_not_found off; } + location = /apple-touch-icon-precomposed.png { access_log off; log_not_found off; } + location ~ /\.ht { deny all; return 404; } + location ~ /\.git { deny all; return 404; } + location ~ /\.svn { deny all; return 404; } + + location ~* ^.+\.(?:jpe?g|gif|bmp|ico|png|css|js|swf)$ { + expires 30d; + access_log off; + add_header Pragma public; + add_header Cache-Control "public, must-revalidate, proxy-revalidate"; + } + + location ~ \.php(/|$) { + include fastcgi_params; + fastcgi_split_path_info ^(.+\.php)(/.*)$; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param HTTPS off; + fastcgi_pass php:9000; + } +} \ No newline at end of file diff --git a/snappymail/snappymail.ini b/snappymail/snappymail.ini new file mode 100644 index 0000000..e29894a --- /dev/null +++ b/snappymail/snappymail.ini @@ -0,0 +1,3 @@ +date.timezone = UTC +upload_max_filesize = 24M +post_max_size = 25M \ No newline at end of file