diff --git a/deployment/docker-compose/README.md b/deployment/docker-compose/README.md index 9fcc683..251d021 100644 --- a/deployment/docker-compose/README.md +++ b/deployment/docker-compose/README.md @@ -21,3 +21,9 @@ docker compose up --force-recreate --detach ```sh ./update.sh ``` + +## Execute commands in web container + +```sh +docker compose exec -it web /bin/sh +``` diff --git a/deployment/docker-compose/nginx.config.example b/deployment/docker-compose/nginx.config.example new file mode 100644 index 0000000..fe99696 --- /dev/null +++ b/deployment/docker-compose/nginx.config.example @@ -0,0 +1,42 @@ +location ^~ /image/ { + root "/var/www/vhosts/oveda.de/cache/img"; + expires 1h; + + location ~ ^/image/(?[0-9]+)/(?[0-9]+) { + if ($arg_s = '') { + rewrite (.*) $1?s=500 last; + } + try_files /${id}-${hash}-${arg_s}-${arg_s}.png /${id}-${hash}-${arg_s}-${arg_s}.jpg @docker; + } + + location ~ ^/image/(?[0-9]+) { + if ($arg_s = '') { + rewrite (.*) $1?s=500 last; + } + try_files /${id}-${arg_s}-${arg_s}.png /${id}-${arg_s}-${arg_s}.jpg @docker; + } +} +location ^~ /static/ { + alias "/var/www/vhosts/oveda.de/static/"; + expires 1h; +} +location ^~ /dump/ { + alias "/var/www/vhosts/oveda.de/cache/dump/"; +} +location ^~ /sitemap.xml { + alias "/var/www/vhosts/oveda.de/cache/sitemap.xml"; +} +location ^~ /robots.txt { + alias "/var/www/vhosts/oveda.de/cache/robots.txt"; +} +location ^~ /favicon.ico { + alias "/var/www/vhosts/oveda.de/static/favicon.ico"; + expires 12h; +} +location @docker { + proxy_pass http://0.0.0.0:5000; + proxy_set_header Host $host; + 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; +} \ No newline at end of file diff --git a/doc/deployment.md b/doc/deployment.md index c93db6d..1ad297f 100644 --- a/doc/deployment.md +++ b/doc/deployment.md @@ -44,6 +44,8 @@ Jobs that should run on a regular basis. ```sh flask event update-recurring-dates flask dump all +flask seo generate-sitemap --pinggoogle +flask seo generate-robots-txt ``` ## Administration