From 8c0facd441fff250778f3547ab5f2a2751a9ad78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20L=C3=BCthi?= Date: Fri, 9 Feb 2024 17:34:23 +0100 Subject: [PATCH 1/4] Include geocop in docker-compose --- Dockerfile | 4 ++-- docker-compose.yml | 18 ++++++++++++++++++ launchSettings.json | 7 +++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1b32b6c9..77719edd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build WORKDIR /src -ARG VERSION -ARG REVISION +ARG VERSION=0.0.1 +ARG REVISION=0000000 # Set default shell SHELL ["/bin/bash", "-c"] diff --git a/docker-compose.yml b/docker-compose.yml index 70b64352..fd939ef4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -54,3 +54,21 @@ services: restart: unless-stopped ports: - 3080:80 + + geocop: + build: + context: . + restart: unless-stopped + ports: + - 5173:80 + environment: + ConnectionStrings__Context: Server=db;Port=5432;Database=geocop;User Id=HAPPYWALK;Password=SOMBERSPORK; + ReverseProxy__Clusters__stacBrowserCluster__Destinations__stacBrowserDestination__Address: http://stac-browser:8080/ + Auth__Authority: https://login.microsoftonline.com/16e916d3-12c9-4353-ad04-5a4319422e03/v2.0 + Auth__ClientId: ac09549e-6cf8-40fe-91a9-25515ec71954 + Validation__InterlisCheckServiceUrl: http://interlis-check-service/ + volumes: + - ./src/GeoCop.Api/Uploads:/uploads + - ./src/GeoCop.Api/Persistent:/assets + - ./src/GeoCop.Frontend/public:/public + diff --git a/launchSettings.json b/launchSettings.json index 8631c229..4e92b5e6 100644 --- a/launchSettings.json +++ b/launchSettings.json @@ -4,8 +4,11 @@ "commandName": "DockerCompose", "commandVersion": "1.0", "serviceActions": { - "db": "Start", - "pgadmin": "Start" + "db": "StartWithoutDebugging", + "pgadmin": "StartWithoutDebugging", + "geocop": "DoNotStart", + "interlis-check-service": "StartWithoutDebugging", + "stac-browser": "StartWithoutDebugging" } } } From 2eaf7ee831311a3408e78cfce16304010be636aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20L=C3=BCthi?= Date: Fri, 9 Feb 2024 17:48:08 +0100 Subject: [PATCH 2/4] Override public assets from override folder --- Dockerfile | 4 +++- docker-entrypoint.sh | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 77719edd..762c2070 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,7 @@ ENV TZ=Europe/Zurich ENV ASPNETCORE_ENVIRONMENT=Production ENV Storage__UploadDirectory=/uploads ENV Storage__AssetsDirectory=/assets +ENV PublicAssetsOverride=/public WORKDIR ${HOME} # Install missing packages @@ -60,7 +61,8 @@ RUN \ useradd --uid 941 --user-group --home $HOME --shell /bin/bash abc && \ usermod --groups users abc && \ mkdir -p $Storage__UploadDirectory && \ - mkdir -p $Storage__AssetsDirectory + mkdir -p $Storage__AssetsDirectory && \ + mkdir -p $PublicAssetsOverride EXPOSE 80 VOLUME $Storage__UploadDirectory diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 8446a121..1228caee 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -5,8 +5,11 @@ set -e echo -n "Fix permissions for mounted volumes ..." && \ chown -R abc:abc $Storage__UploadDirectory && \ chown -R abc:abc $Storage__AssetsDirectory && \ + chown -R abc:abc $PublicAssetsOverride && \ echo "done!" +# Override public assets in app's public directory. +cp -R $PublicAssetsOverride/* $HOME/wwwroot/ echo " -------------------------------------------------------------------------- From 4f88292c810801715592b681da7b72a942d93ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20L=C3=BCthi?= Date: Mon, 12 Feb 2024 10:27:20 +0100 Subject: [PATCH 3/4] Map README/LICENSE to public folder --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index fd939ef4..46dd0d15 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -70,5 +70,5 @@ services: volumes: - ./src/GeoCop.Api/Uploads:/uploads - ./src/GeoCop.Api/Persistent:/assets - - ./src/GeoCop.Frontend/public:/public - + - ./README.md:/public/info-hilfe.md + - ./LICENSE:/public/nutzungsbestimmungen.md From 2987d4e3c2ab7d8fc229c33db6301db8284a927e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20L=C3=BCthi?= Date: Fri, 9 Feb 2024 17:49:07 +0100 Subject: [PATCH 4/4] Include docker-related files & md files as solution items --- GeoCop.sln | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/GeoCop.sln b/GeoCop.sln index d99d5102..97ae91d6 100644 --- a/GeoCop.sln +++ b/GeoCop.sln @@ -14,6 +14,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GeoCop.Api.Test", "tests\Ge EndProject Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{41D679A6-C4B1-4B18-B9AB-BEC6C647A180}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CD69434B-998E-429D-998B-DF221BB32C55}" + ProjectSection(SolutionItems) = preProject + docker-entrypoint.sh = docker-entrypoint.sh + Dockerfile = Dockerfile + LICENSE = LICENSE + README.md = README.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU