-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add possibility to run localtest in docker with --profile (#7898)
* Add possibility to run localtest in docker with --profile ``` cd src/development docker compose --profile localtest up --build ``` Also add .env.template file in `src/development` to make it easy to set environment variables to configure docker. Just rename to the gitignored .env file and make your changes. * Update src/development/LocalTest/appsettings.Docker.json * Use resourceService to get local text resources instead of fetching from storage This means IText is not used anywhere, but because every app inherits from AppBase, it can't be removed. * Make it really easy to change domain to use local.altinn.cloud altinn3local.no is used in lots of tests, and I can't really fix it everywhere, but I think that this change should be non-breaking for everyone without a TEST_DOMAIN environment variable that does not resolve to localhost
- Loading branch information
Showing
9 changed files
with
105 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## This is a template for the .env file | ||
## To use this, rename the file from .env.template to .env | ||
## and uncomment some variables that you want different values for | ||
|
||
## What port should the locadbalancer use | ||
## sometimes PCs have another service running on port 80, so you might need to | ||
## change this. | ||
#ALTINN3LOCAL_PORT=80 | ||
|
||
## If you want to see the storage files on disk (instead of readig them trough | ||
## the browser), change this to a local path on your computer (ensure that it exists) | ||
#ALTINN3LOCALSTORAGE_PATH:C:/AltinnPlatformLocal/ | ||
|
||
## If you want to use another domain than altinn3local.no for local testing | ||
## add it here | ||
#TEST_DOMAIN:local.altinn.cloud |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine AS build | ||
WORKDIR /LocalTest | ||
|
||
COPY ./LocalTest/LocalTest.csproj /LocalTest | ||
RUN dotnet restore LocalTest.csproj | ||
|
||
COPY ./LocalTest /LocalTest | ||
|
||
|
||
RUN ls / | ||
RUN dotnet build LocalTest.csproj -c Release -o /app_output | ||
RUN dotnet publish LocalTest.csproj -c Release -o /app_output | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine AS final | ||
EXPOSE 5101 | ||
WORKDIR /app | ||
COPY --from=build /app_output . | ||
|
||
# Copy various data | ||
COPY ./TestData /TestData | ||
|
||
# setup the user and group (not important for LocalTest and this removes write access to /AltinnPlatformLocal) | ||
# RUN addgroup -g 3000 dotnet && adduser -u 1000 -G dotnet -D -s /bin/false dotnet | ||
# USER dotnet | ||
|
||
ENTRYPOINT ["dotnet", "LocalTest.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"LocalPlatformSettings": { | ||
"LocalAppMode": "http", | ||
"LocalAppUrl": "http://host.docker.internal:5005", | ||
"LocalTestingStorageBasePath": "/AltinnPlatformLocal/", | ||
"LocalTestingStaticTestDataPath": "/TestData/" | ||
} | ||
} |