diff --git a/docker-compose.yml b/docker-compose.yml index 1de4ad2..f4a2188 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,5 @@ +version: '3.8' + services: frontend: build: @@ -9,8 +11,7 @@ services: - "80:80" - "443:443" volumes: - - certbot-etc:/etc/letsencrypt - - certbot-var:/var/lib/letsencrypt + - certbot-etc:/etc/letsencrypt:ro - webroot:/var/www/html depends_on: - backend @@ -39,7 +40,7 @@ services: - webroot:/var/www/html depends_on: - frontend - command: certonly --webroot --webroot-path=/var/www/html --email admin@itformhelp.ru --agree-tos --no-eff-email --force-renewal -d itformhelp.ru -d www.itformhelp.ru + command: certonly --webroot --webroot-path=/var/www/html --email admin@itformhelp.ru --agree-tos --no-eff-email --force-renewal --staging -d itformhelp.ru -d www.itformhelp.ru volumes: sqlite_data: diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index 34491e9..4b402e4 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -1,23 +1,24 @@ -server { - listen 80; - listen [::]:80; - server_name itformhelp.ru www.itformhelp.ru; - - root /usr/share/nginx/html; - index index.html; +user nginx; +worker_processes auto; +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; - location / { - try_files $uri $uri/ /index.html; - expires -1; - add_header Cache-Control "no-store, no-cache, must-revalidate"; - } - - location /api/ { - proxy_pass http://backend:8000/api/; - proxy_http_version 1.1; - 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; - } +events { + worker_connections 1024; +} + +http { + 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; + + sendfile on; + keepalive_timeout 65; + + include /etc/nginx/conf.d/*.conf; }