From 8681247e76fbb8637ed1b993a426192fe955952f Mon Sep 17 00:00:00 2001 From: ThompsonNye Date: Tue, 24 Jun 2025 19:12:29 +0200 Subject: [PATCH] Adjustments for working deployment --- src/Vegasco-Web/Dockerfile | 5 +++++ src/Vegasco-Web/nginx.conf | 9 ++------- src/Vegasco-Web/webserver.conf.template | 12 ++++++++++++ src/Vegasco.Server.AppHost.Shared/Constants.cs | 2 +- 4 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 src/Vegasco-Web/webserver.conf.template diff --git a/src/Vegasco-Web/Dockerfile b/src/Vegasco-Web/Dockerfile index 578e7eb..c3bdda0 100644 --- a/src/Vegasco-Web/Dockerfile +++ b/src/Vegasco-Web/Dockerfile @@ -7,7 +7,12 @@ RUN pnpm install RUN pnpm "build:$CONFIGURATION" FROM nginx:alpine +RUN rm /etc/nginx/conf.d/* + +ENV DOLLAR=$ + WORKDIR /usr/share/nginx/html COPY --from=build /usr/local/app/dist/Vegasco-Web/browser . COPY nginx.conf /etc/nginx/nginx.conf +COPY webserver.conf.template /etc/nginx/templates/webserver.conf.template EXPOSE 80 diff --git a/src/Vegasco-Web/nginx.conf b/src/Vegasco-Web/nginx.conf index 340e459..0cd7817 100644 --- a/src/Vegasco-Web/nginx.conf +++ b/src/Vegasco-Web/nginx.conf @@ -2,12 +2,7 @@ events { } http { include mime.types; - server { - listen 80; + resolver 8.8.8.8 8.8.4.4 1.1.1.1; - location / { - root /usr/share/nginx/html; - try_files $uri $uri/ /index.html =404; - } - } + include /etc/nginx/conf.d/webserver.conf; } diff --git a/src/Vegasco-Web/webserver.conf.template b/src/Vegasco-Web/webserver.conf.template new file mode 100644 index 0000000..b4c7d35 --- /dev/null +++ b/src/Vegasco-Web/webserver.conf.template @@ -0,0 +1,12 @@ +server { + listen 80; + + location ~ ^/api/(.*) { + proxy_pass ${services__Vegasco_Server_Api__https__0}/$1; + } + + location / { + root /usr/share/nginx/html; + try_files ${DOLLAR}uri ${DOLLAR}uri/ /index.html =404; + } +} \ No newline at end of file diff --git a/src/Vegasco.Server.AppHost.Shared/Constants.cs b/src/Vegasco.Server.AppHost.Shared/Constants.cs index b220976..9c1dc4c 100644 --- a/src/Vegasco.Server.AppHost.Shared/Constants.cs +++ b/src/Vegasco.Server.AppHost.Shared/Constants.cs @@ -4,7 +4,7 @@ public static class Constants { public static class Projects { - public const string Api = "Vegasco-Server-Api"; + public const string Api = "Vegasco_Server_Api"; } public static class Database