-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
78 additions
and
3 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
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,45 @@ | ||
name: Build Microservice Demo App (Machine) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- "NetCoreMicroserviceSample/NetCoreMicroserviceSample.Api/**" | ||
- "NetCoreMicroserviceSample/NetCoreMicroserviceSample.UserInterface/**" | ||
env: | ||
DOTNET_VERSION: '5.0' | ||
MACHINE_PATH: './NetCoreMicroserviceSample/NetCoreMicroserviceSample.Machine' | ||
CONFIG: 'Debug' | ||
|
||
jobs: | ||
build: | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: 'Checkout GitHub Action' | ||
uses: actions/checkout@master | ||
|
||
- name: Setup DotNet ${{ env.DOTNET_VERSION }} Environment | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ${{ env.MACHINE_PATH }}/.. | ||
file: ${{ env.MACHINE_PATH }}/Dockerfile | ||
push: true | ||
tags: rstropek/net-core-microservice-sample-machine:latest |
15 changes: 15 additions & 0 deletions
15
NetCoreMicroserviceSample/NetCoreMicroserviceSample.Machine/Dockerfile
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,15 @@ | ||
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build | ||
WORKDIR /app | ||
|
||
# copy csproj and restore as distinct layers | ||
COPY NetCoreMicroserviceSample.Machine/*.csproj NetCoreMicroserviceSample.Machine/ | ||
RUN cd NetCoreMicroserviceSample.Machine && dotnet restore | ||
|
||
# copy everything else and build app | ||
COPY . . | ||
RUN cd NetCoreMicroserviceSample.Machine && dotnet publish -c Release -o out | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime | ||
WORKDIR /app | ||
COPY --from=build /app/NetCoreMicroserviceSample.Machine/out ./ | ||
ENTRYPOINT ["dotnet", "NetCoreMicroserviceSample.Machine.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
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 |
---|---|---|
|
@@ -8,9 +8,16 @@ | |
}, | ||
"Oidc": { | ||
"Domain": "https://demo.identityserver.io", | ||
"Audience": "api", | ||
"Audience": "api", | ||
"ClientId": "interactive.confidential", | ||
"ClientSecret": "secret" | ||
}, | ||
"AllowedHosts": "*" | ||
"AllowedHosts": "*", | ||
"UseLetsEncrypt": true, | ||
"LettuceEncrypt": { | ||
"AcceptTermsOfService": true, | ||
"UseStagingServer": true, | ||
"DomainNames": [ "machine-microservice-training.westeurope.azurecontainer.io" ], | ||
"EmailAddress": "[email protected]" | ||
} | ||
} |