improvements

main
alex 2023-11-02 21:14:52 +01:00
parent 35b614b4fc
commit d2da2e0249
6 changed files with 65 additions and 2 deletions

4
Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM nginx:latest
COPY ./build /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/conf.d/default.conf

9
build-docker.sh Executable file
View File

@ -0,0 +1,9 @@
# only allow to run this script as root
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
echo "Starting static web build of admin-dashboard-web"
npm run build
echo "Finished static web build of admin-dashboard-web"

18
docker-compose.yml Normal file
View File

@ -0,0 +1,18 @@
version: "3"
services:
jnx-admin-dashboard-proxy:
image: jnx-admin-dashboard-proxy:latest
restart: always
build:
context: .
dockerfile: nginx/Dockerfile
ports:
# CHANGE HOST/PORT IF NEEDED
#- "127.0.0.1:80:80"
- "80:80"
networks:
- jnx-admin-dashboard-network
depends_on:
- jnx-admin-dashboard-server
- jnx-log-manager-server

33
nginx.conf Normal file
View File

@ -0,0 +1,33 @@
# nginx/nginx.conf
server {
listen 80;
location /api/ { # api server
client_max_body_size 0;
proxy_http_version 1.0;
proxy_pass http://jnx-admin-dashboard-server:8080/;
}
location /ws { # websocket server
proxy_read_timeout 10800s;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_pass http://jnx-admin-dashboard-server:8080/ws/;
proxy_http_version 1.1;
}
location /lm/ { # log manager server
client_max_body_size 0;
proxy_http_version 1.0;
proxy_set_header Connection ""; # needed for sse
proxy_pass http://jnx-log-manager-server:3000/;
}
location / { # frontend
root /usr/share/nginx/html;
index index.html;
try_files $uri /index.html;
}
}

View File

@ -1,6 +1,5 @@
import {
CopyOutlined,
DisconnectOutlined,
EyeInvisibleOutlined,
EyeOutlined,
ReloadOutlined,

View File

@ -1425,7 +1425,7 @@ export function myFetch(
body: getBody(),
};
if (fetchUrl == "") {
if (fetchUrl === "") {
fetchUrl = Constants.API_ADDRESS;
}