snf.wsring.net

Search

Items tagged with: server

This is my working docker-compose.yml

version: '2'
# Testkommentar

services:
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- db:/var/lib/mysql/
environment:
- MYSQL_ROOT_PASSWORD=ASDFGJKLÖÄ
env_file:
- db.env
- smtp.env
- friendica.env
networks:
- proxy-tier

app:
image: friendica/server:fpm
restart: always
volumes:
- friendica:/var/www/html
- ./app/local.config.php:/var/www/html/config/local.config.php
environment:
- AUTOINSTALL=true
- MAILNAME=friendica.schuerz.at
- TZ=EUROPE/Vienna
- LANGUAGE=de
env_file:
- db.env
- smtp.env
- friendica.env
depends_on:
- db
networks:
- proxy-tier
- default

web:
image: nginx
restart: always
volumes:
- friendica:/var/www/html:ro
- ./web/nginx.conf:/etc/nginx/nginx.conf:ro
environment:
- VIRTUAL_HOST=friendica.schuerz.at
- LETSENCRYPT_HOST=friendica.schuerz.at
- LETSENCRYPT_EMAIL=XXX@YYY.ZZ
depends_on:
- app
env_file:
- db.env
- smtp.env
- friendica.env
networks:
- proxy-tier
- default

cron:
image: friendica/server:fpm
restart: always
volumes:
- friendica:/var/www/html:ro
- ./app/local.config.php:/var/www/html/config/local.config.php:ro
entrypoint: /cron.sh
env_file:
- db.env
- friendica.env
depends_on:
- db
- app
networks:
- proxy-tier

proxy:
build: ./proxy
restart: always
ports:
- 80:80
- 443:443
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
volumes:
- certs:/etc/nginx/certs:ro
- vhost.d:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- proxy-tier
- default

letsencrypt-companion:
image: jrcs/letsencrypt-nginx-proxy-companion
restart: always
volumes:
- certs:/etc/nginx/certs
- vhost.d:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- proxy-tier
depends_on:
- proxy

volumes:
db:
friendica:
certs:
vhost.d:
html:

networks:
proxy-tier:
default:



cat proxy/Dockerfile
FROM jwilder/nginx-proxy:alpine

COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf


cat proxy/uploadsize.conf
client_max_body_size 10G;


cat web/nginx.conf
##
# Friendica Nginx configuration
# by Olaf Conradi, modified by Philipp Holzer
#
worker_processes 4;

events {
worker_connections 1024;
}

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

http {
charset utf-8;

include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

# If behind reverse proxy, forwards the correct IP
set_real_ip_from 10.0.0.0/8;
set_real_ip_from 172.16.0.0/12;
set_real_ip_from 192.168.0.0/16;
set_real_ip_from fc00::/7;
real_ip_header X-Real-IP;

upstream php-handler {
server app:9000;
}

server {
listen 80;
#server name social.schuerz.at;
server_name friendica.schuerz.at;

index index.php;

root /var/www/html;
#Uncomment the following line to include a standard configuration file
#Note that the most specific rule wins and your standard configuration
#will therefore *add* to this file, but not override it.
#include standard.conf
# allow uploads up to 20MB in size
client_max_body_size 20m;
client_body_buffer_size 128k;

# rewrite to front controller as default rule
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?pagename=$1;
}
}
# make sure webfinger and other well known services aren't blocked
# by denying dot files and rewrite request to the front controller
location ^~ /.well-known/ {
allow all;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?pagename=$1;
}
}

# statically serve these file types when possible
# otherwise fall back to front controller
# allow browser to cache them
# added .htm for advanced source code editor library
#location ~* \.(jpg|jpeg|gif|png|ico|css|js|htm|html|ttf|woff|svg)$ {
# expires 30d;
# try_files $uri /index.php?pagename=$uri&$args;
#}

include mime.types;

# block these file types
location ~* \.(tpl|md|tgz|log|out)$ {
deny all;
}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
# or a unix socket
location ~* \.php$ {
# Zero-day exploit defense.
# http://forum.nginx.org/read.php?2,88845,page=3
# Won't work properly (404 error) if the file is not stored on this
# server, which is entirely possible with php-fpm/php-fcgi.
# Comment the 'try_files' line out if you set up php-fpm/php-fcgi on
# another machine. And then cross your fingers that you won't get hacked.
try_files $uri =404;

# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_split_path_info ^(.+\.php)(/.+)$;

fastcgi_pass php-handler;

include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

# deny access to all dot files
location ~ /\. {
deny all;
}
}
}
 
Later posts Earlier posts