diff --git a/Dockerfile b/Dockerfile index 26b82448d195dac45c70e4363343a0179c43ffc8..754183c78e1d8bd2e21556141e654aaa82cffe52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,10 +69,9 @@ RUN install_packages nginx-light RUN chown -R appuser:appuser /var/lib/nginx /var/log/nginx -COPY deployment/docker/nginx-standalone.conf /etc/nginx/nginx.conf COPY --from=monolith /app/static.dist /app/static.dist -CMD ["nginx"] +CMD ["nginx", "-c", "/data/nginx.conf"] FROM monolith as default_image diff --git a/deployment/docker/nginx-standalone.conf b/deployment/docker/nginx-standalone.conf deleted file mode 100644 index 450dbf77151bd49079185399caf48cb05a74e3f6..0000000000000000000000000000000000000000 --- a/deployment/docker/nginx-standalone.conf +++ /dev/null @@ -1,77 +0,0 @@ -user appuser appuser; -worker_processes auto; -daemon off; - -events { - worker_connections 2048; -} - -http { - server_tokens off; - sendfile on; - charset utf-8; - tcp_nopush on; - tcp_nodelay on; - client_max_body_size 50M; - - types_hash_max_size 2048; - server_names_hash_bucket_size 64; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - add_header X-Content-Type-Options nosniff; - - access_log /data/access.log combined; - error_log /data/error.log; - add_header Referrer-Policy same-origin; - - gzip on; - gzip_disable "msie6"; - gzip_types text/plain text/html text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml image/svg+xml; - gzip_vary on; - gzip_proxied any; - gzip_comp_level 6; - gzip_buffers 16 8k; - - include /etc/nginx/conf.d/*.conf; - - server { - listen 80 backlog=4096 default_server; - listen [::]:80 ipv6only=on default_server; - server_name _; - - return 301 https://$host$request_uri; - } - - server { - listen 443 backlog=4096 ssl http2; - listen [::]:443 ipv6only=on ssl http2; - server_name _; - index index.html; - root /var/www; - - ssl_certificate /data/fullchain.pem; - ssl_certificate_key /data/privkey.pem; - - location /static/ { - alias /app/static.dist/; - access_log off; - expires 365d; - add_header Cache-Control "public"; - } - - location /media/ { - alias /media/; - autoindex off; - access_log off; - expires 365d; - add_header Cache-Control "public"; - } - - location / { - proxy_pass http://hub:8000/; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $http_host; - } - } -}