From 592b28729bbe29b0b84941f128cdad76d075c94f Mon Sep 17 00:00:00 2001 From: Craig Osterhout <103533812+craig-osterhout@users.noreply.github.com> Date: Mon, 17 Mar 2025 15:33:50 -0700 Subject: [PATCH] guides: fix port in .net guide (#22269) ## Description The default port changed from 80 to 8080 when we switched to a newer version of .net in #21877. https://learn.microsoft.com/en-us/dotnet/core/compatibility/containers/8.0/aspnet-port https://deploy-preview-22269--docsdocker.netlify.app/guides/dotnet/develop/ https://deploy-preview-22269--docsdocker.netlify.app/guides/dotnet/deploy/ ## Related issues or tickets Closes #22265 Related to #22080 ENGDOCS-2492 ## Reviews - [ ] Technical review --------- Signed-off-by: Craig --- content/guides/dotnet/deploy.md | 4 ++-- content/guides/dotnet/develop.md | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/content/guides/dotnet/deploy.md b/content/guides/dotnet/deploy.md index ed1b464e95..837917a0ba 100644 --- a/content/guides/dotnet/deploy.md +++ b/content/guides/dotnet/deploy.md @@ -64,7 +64,7 @@ spec: name: server imagePullPolicy: Always ports: - - containerPort: 80 + - containerPort: 8080 hostPort: 8080 protocol: TCP resources: {} @@ -117,7 +117,7 @@ spec: ports: - name: "8080" port: 8080 - targetPort: 80 + targetPort: 8080 nodePort: 30001 selector: service: server diff --git a/content/guides/dotnet/develop.md b/content/guides/dotnet/develop.md index 3c8ecf1ad5..d5bea5491f 100644 --- a/content/guides/dotnet/develop.md +++ b/content/guides/dotnet/develop.md @@ -182,9 +182,9 @@ $ docker container ls You should see output like the following. ```console -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -cb36e310aa7e docker-dotnet-server "dotnet myWebApp.dll" About a minute ago Up About a minute 0.0.0.0:8080->80/tcp docker-dotnet-server-1 -39fdcf0aff7b postgres "docker-entrypoint.s…" About a minute ago Up About a minute (healthy) 5432/tcp docker-dotnet-db-1 +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +cb36e310aa7e docker-dotnet-server "dotnet myWebApp.dll" About a minute ago Up About a minute 0.0.0.0:8080->8080/tcp docker-dotnet-server-1 +39fdcf0aff7b postgres "docker-entrypoint.s…" About a minute ago Up About a minute (healthy) 5432/tcp docker-dotnet-db-1 ``` In the previous example, the container ID is `39fdcf0aff7b`. Run the following command to connect to the postgres database in the container. Replace the container ID with your own container ID. @@ -241,7 +241,7 @@ services: context: . target: final ports: - - 8080:80 + - 8080:8080 depends_on: db: condition: service_healthy @@ -337,14 +337,14 @@ ENTRYPOINT ["dotnet", "myWebApp.dll"] The following is the updated `compose.yaml` file. -```yaml {hl_lines="5"} +```yaml {hl_lines=[5,15,16]} services: server: build: context: . target: development ports: - - 8080:80 + - 8080:8080 depends_on: db: condition: service_healthy @@ -354,7 +354,6 @@ services: path: . environment: - ASPNETCORE_ENVIRONMENT=Development - - ASPNETCORE_URLS=http://+:80' db: image: postgres restart: always