Dockerise app

This commit is contained in:
SharkoZ
2019-09-03 08:57:13 +02:00
parent 66d3bc562d
commit cbcb25a25c
2 changed files with 38 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
FROM nginx:alpine
EXPOSE 80
ENV LISTEN_PORT=80 \
SERVER_URL=otrecorder \
SERVER_PORT=80
COPY nginx.tmpl /etc/nginx/nginx.tmpl
COPY index.html /usr/share/nginx/html
COPY static/ /usr/share/nginx/html/static/
RUN ls /usr/share/nginx/html/*
CMD /bin/sh -c "envsubst '\${SERVER_URL} \${SERVER_PORT} \${LISTEN_PORT}' < /etc/nginx/nginx.tmpl > /etc/nginx/nginx.conf && nginx -g 'daemon off;' || cat /etc/nginx/nginx.conf"
+26
View File
@@ -0,0 +1,26 @@
worker_processes 1;
events {
worker_connections 1024;
}
http {
upstream otrecorder {
server ${SERVER_URL}:${SERVER_PORT};
}
server {
listen ${LISTEN_PORT};
root /usr/share/nginx/html;
location /api {
proxy_pass http://otrecorder/api/;
}
location /ws {
proxy_pass http://otrecorder/ws/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
}
location / {
try_files $uri $uri/index.html;
}
}
}