Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker UI configuration support #153

Merged
merged 4 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions GeoCop.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
- ./README.md:/public/info-hilfe.md
- ./LICENSE:/public/nutzungsbestimmungen.md
3 changes: 3 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
--------------------------------------------------------------------------
Expand Down
7 changes: 5 additions & 2 deletions launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down
Loading