[mod] proxy nginx config is now generated based on domains.env

- domains and servers in domains.env are mapped 1:1
 - moved domains.env to ./files/domains.env
 - renamed kweb to web for a more generic approach
This commit is contained in:
2020-05-27 15:58:21 -04:00
parent 3d778ff698
commit f3d17e931a
8 changed files with 130 additions and 46 deletions

21
web/Dockerfile Normal file
View File

@@ -0,0 +1,21 @@
FROM nginx:1.17.9-alpine
ARG USER_UUID=12000
ARG USER_GUID=12000
ARG GROUP_NAME=proxy
ARG USER_NAME=proxy
RUN set -eux; \
addgroup -g $USER_GUID $GROUP_NAME; \
adduser -u $USER_UUID -G $GROUP_NAME -s /sbin/nologin -D $USER_NAME;
# create temp dir for service
RUN mkdir -p /service/temp \
&& chown -R $USER_NAME:$GROUP_NAME /service/temp
# copy configuration and entrypoint.sh
COPY ./files/nginx.conf /etc/nginx/nginx.conf
COPY ./files/index.html /service/html/index.html
USER $USER_NAME

6
web/files/index.html Normal file
View File

@@ -0,0 +1,6 @@
<html>
<head>
<title>kweb</title>
</head>
<body>online</body>
</html>

31
web/files/nginx.conf Normal file
View File

@@ -0,0 +1,31 @@
worker_processes 1;
events { worker_connections 1024; }
# required for non root
pid /tmp/nginx.pid;
http {
# required for non root
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
fastcgi_temp_path /tmp/fastcgi_temp;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
client_max_body_size 1m;
server {
listen 8080 default_server;
# prevent redirecting to 8080 port
# (e.g. when trailing slash is missed)
port_in_redirect off;
location / {
root /service/html;
}
}
}