diff --git a/.github/workflows/deploy.test-env.yml b/.github/workflows/deploy.test-env.yml index 3ff5842..43169fa 100644 --- a/.github/workflows/deploy.test-env.yml +++ b/.github/workflows/deploy.test-env.yml @@ -12,6 +12,7 @@ jobs: env: RUNNER_TOOL_CACHE: /toolcache IMAGE_NAME: rbl-news-webapp + DOCKER_CONTAINER_NAME: rbl-news-webapp-test REGISTRY: git.wohlleben.dev REPO_OWNER: itob steps: @@ -36,8 +37,8 @@ jobs: username: ${{ vars.SRV02_DOCKER_VM_USER_NAME }} key: ${{ vars.SRV02_DOCKER_VM_ROOT_USER_SSH_KEY }} script: | - docker pull git.wohlleben.dev/itob/rbl-news-webapp:latest - docker stop rbl-news-webapp - docker rm rbl-news-webapp - docker run --init -d --name rbl-news-webapp -p 8000:80 --restart=always git.wohlleben.dev/itob/rbl-news-webapp:latest + docker pull git.wohlleben.dev/itob/${DOCKER_CONTAINER_NAME}:latest + docker stop ${DOCKER_CONTAINER_NAME} + docker rm ${DOCKER_CONTAINER_NAME} + docker run --init -d --name ${DOCKER_CONTAINER_NAME} -p 8081:81 --build-arg docker_external_http_port=81 --restart=always git.wohlleben.dev/itob/${DOCKER_CONTAINER_NAME}:latest docker system prune -af \ No newline at end of file diff --git a/IaC/RBLNews.Web/Dockerfile b/IaC/RBLNews.Web/Dockerfile index d357437..1c8139c 100644 --- a/IaC/RBLNews.Web/Dockerfile +++ b/IaC/RBLNews.Web/Dockerfile @@ -3,6 +3,8 @@ WORKDIR /app EXPOSE 80 EXPOSE 8080 EXPOSE 443 +ARG docker_external_http_port +ENV ASPNETCORE_URLS=http://+:docker_external_http_port FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release