From 60dc2b012278bd5761aec4620bc777987cad07f0 Mon Sep 17 00:00:00 2001
From: Gigadoc2 <gigadoc2@revreso.de>
Date: Sat, 26 Dec 2020 03:36:16 +0100
Subject: [PATCH] move nginx config out of image

It contains environment-specific config (the docker service names), and
I need to update it faster than the merge request process.
---
 Dockerfile                              |  3 +-
 deployment/docker/nginx-standalone.conf | 77 -------------------------
 2 files changed, 1 insertion(+), 79 deletions(-)
 delete mode 100644 deployment/docker/nginx-standalone.conf

diff --git a/Dockerfile b/Dockerfile
index 26b82448d..754183c78 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 450dbf771..000000000
--- 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;
-		}
-	}
-}
-- 
GitLab