Browse Source

Make docker config more in line with the VRE application

master
Joshua Rubingh 4 months ago
parent
commit
8cae9aa60e
  1. 16
      docker/Dockerfile.nginx
  2. 5
      docker/Dockerfile.tusd
  3. 11
      nginx/tus.vhost.conf

16
docker/Dockerfile.nginx

@ -1,10 +1,16 @@
FROM nginx:mainline
# Use the official NGINX image from the Docker Hub. But cached by the RUG registry to not to hit rate limits
FROM registry.webhosting.rug.nl/cache/library/nginx:mainline
#FROM nginx:mainline
RUN sed -i 's@user nginx;@user nginx;\nload_module modules/ngx_http_js_module.so;\nload_module modules/ngx_stream_js_module.so;@' /etc/nginx/nginx.conf
RUN apt-get update && apt-get -y full-upgrade
COPY ./nginx/tus.vhost.conf /etc/nginx/conf.d/
RUN sed -i 's@user nginx;@user nginx;\nload_module modules/ngx_http_js_module.so;\nload_module modules/ngx_stream_js_module.so;@' /etc/nginx/nginx.conf
COPY ./nginx/njs/dropoff_tus.js /etc/nginx/
RUN rm /etc/nginx/conf.d/default.conf
RUN sed -i 's@http://localhost:1080;@http://upload-server:1080;@g' /etc/nginx/conf.d/tus.vhost.conf
RUN mkdir /etc/nginx/templates
COPY ./nginx/tus.vhost.conf /etc/nginx/templates/default.conf.template
# TODO: Make the resolver IP and instance hostname more variable!!
RUN sed -i "s@resolver.*;@resolver 10.43.0.10 valid=30s;@g" /etc/nginx/templates/default.conf.template
RUN sed -i 's@localhost@upload-server@g' /etc/nginx/templates/default.conf.template

5
docker/Dockerfile.tusd

@ -1,5 +1,6 @@
# Use the official Python image from the Docker Hub
FROM python:3.8
# Use the official Python image from the Docker Hub. But cached by the RUG registry to not to hit rate limits
FROM registry.webhosting.rug.nl/cache/library/python:3.8
#FROM python:3.8
# These two environment variables prevent __pycache__/ files.
ENV PYTHONUNBUFFERED 1

11
nginx/tus.vhost.conf

@ -42,6 +42,11 @@ server {
#
# include snippets/snakeoil.conf;
# Kubernetes DNS resolv info....
# https://www.nginx.com/blog/dns-service-discovery-nginx-plus/ -> 'Setting the Domain Name in a Variable'
# https://developpaper.com/nginx-dynamic-resolve-upstream-servers/
resolver 127.0.0.1 valid=30s;
root /var/www/html;
# Add index.php to the list if you are using PHP
@ -80,7 +85,8 @@ server {
# https://github.com/tus/tusd/blob/master/examples/nginx.conf
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://localhost:1080;
set $tus_upload localhost;
proxy_pass http://$tus_upload:1080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@ -105,7 +111,8 @@ server {
# https://github.com/tus/tusd/blob/master/examples/nginx.conf
proxy_set_header X-Forwarded-Proto https;
proxy_pass http://localhost:1080;
set $tus_upload localhost;
proxy_pass http://$tus_upload:1080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;

Loading…
Cancel
Save