From 14338ff5ac0e6d6405e739cc8d75572854092b4d Mon Sep 17 00:00:00 2001 From: mfnefd Date: Sun, 3 Nov 2024 20:51:32 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B5=D1=89=D0=B5=20=D1=80=D0=B0=D0=B7=D0=BE?= =?UTF-8?q?=D0=BA=20=D0=BF=D0=BE=D0=BF=D1=8B=D1=82=D0=B0=D0=B5=D0=BC=20?= =?UTF-8?q?=D1=83=D0=B4=D0=B0=D1=87=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApiRestaurant/Dockerfile | 3 +- balakhonov_danila_lab_3/nginx.conf | 36 ++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/balakhonov_danila_lab_3/ApiRestaurant/Dockerfile b/balakhonov_danila_lab_3/ApiRestaurant/Dockerfile index 5809cb3..b11051a 100644 --- a/balakhonov_danila_lab_3/ApiRestaurant/Dockerfile +++ b/balakhonov_danila_lab_3/ApiRestaurant/Dockerfile @@ -8,7 +8,8 @@ RUN dotnet restore # Build and publish a release RUN dotnet publish -c Release -o out -FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS app +ENV ASPNETCORE_URLS=http://*:5089 WORKDIR /App COPY --from=build /App/out . ENTRYPOINT ["dotnet", "ApiRestaurant.dll"] \ No newline at end of file diff --git a/balakhonov_danila_lab_3/nginx.conf b/balakhonov_danila_lab_3/nginx.conf index 6580d1c..7c83869 100644 --- a/balakhonov_danila_lab_3/nginx.conf +++ b/balakhonov_danila_lab_3/nginx.conf @@ -1,21 +1,23 @@ -server { - listen 80; - listen [::]:80; - server_name localhost; +http { + server { + listen 80; + listen [::]:80; + server_name localhost; - location /waiters/ { - proxy_pass http://waiter-service:4000/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Prefix /test; - } + location /waiters/ { + proxy_pass http://waiter-service:4000/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Prefix /test; + } - location /restaurants/ { - proxy_pass http://restaurant-service:5089/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Prefix /admin; + location /restaurants/ { + proxy_pass http://restaurant-service:5089/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Prefix /admin; + } } }