diff --git a/docker-compose.yml.tmpl b/docker-compose.yml.tmpl index 049c04ca2..c449d2fde 100644 --- a/docker-compose.yml.tmpl +++ b/docker-compose.yml.tmpl @@ -131,7 +131,7 @@ services: context: . dockerfile: docker/Dockerfile.nginx ports: - - 80:80 + - 443:443 environment: - HOME=/data depends_on: diff --git a/docker/Dockerfile.nginx.tmpl b/docker/Dockerfile.nginx.tmpl index 82a56e49a..48155aaef 100644 --- a/docker/Dockerfile.nginx.tmpl +++ b/docker/Dockerfile.nginx.tmpl @@ -13,6 +13,11 @@ ENV GIT_SHORT_HASH=$GIT_SHORT_HASH ENV GIT_BRANCH=$GIT_BRANCH COPY docker/nginx/nginx.conf /etc/nginx/sites-enabled/anthias.conf + +# @TODO: Find a way to generate the cert and key files ad-hoc. +COPY docker/nginx/cert.pem /etc/nginx/cert.pem +COPY docker/nginx/key.pem /etc/nginx/key.pem + RUN rm -f /etc/nginx/sites-enabled/default CMD ["nginx", "-g", "daemon off;"] diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index 22f3d96ec..067fae3ba 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -14,9 +14,16 @@ upstream websocket { server { server_tokens off; + listen 80 default_server; listen [::]:80 default_server; + listen 443 ssl; + listen [::]:443 ssl; + + ssl_certificate /etc/nginx/cert.pem; + ssl_certificate_key /etc/nginx/key.pem; + location / { # Temporarily disables wifi-connect