Skip to content

Add Docker image #9

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

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4d303ad
Bump ini from 1.3.5 to 1.3.8 in /client/azdo-merge-bot
dependabot[bot] Dec 12, 2020
cad6b5b
Bump elliptic from 6.5.2 to 6.5.4 in /client/azdo-merge-bot
dependabot[bot] Mar 10, 2021
801f393
Bump y18n from 4.0.0 to 4.0.1 in /client/azdo-merge-bot
dependabot[bot] Apr 1, 2021
483b418
Bump ssri from 6.0.1 to 6.0.2 in /client/azdo-merge-bot
dependabot[bot] Apr 30, 2021
55d96d0
Bump lodash from 4.17.19 to 4.17.21 in /client/azdo-merge-bot
dependabot[bot] May 11, 2021
733523b
Bump hosted-git-info from 2.8.8 to 2.8.9 in /client/azdo-merge-bot
dependabot[bot] May 11, 2021
6b7fd70
Bump postcss from 7.0.31 to 7.0.36 in /client/azdo-merge-bot
dependabot[bot] Jun 17, 2021
07b94df
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/client/a…
BoBiene Jul 16, 2021
dd91149
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/client/a…
BoBiene Jul 16, 2021
f8540db
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/client/a…
BoBiene Jul 16, 2021
86b6f96
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/client/a…
BoBiene Jul 16, 2021
15f1d7c
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/client/a…
BoBiene Jul 16, 2021
4d2f39b
Merge remote-tracking branch 'origin/dependabot/npm_and_yarn/client/a…
BoBiene Jul 16, 2021
0ad9a24
Create docker-image.yml
BoBiene Jul 16, 2021
c9123c2
Update Dependencies and add Dockerfile
BoBiene Jul 16, 2021
e61dd61
Merge branch 'master' of https://github.com/BoBiene/azure-devops-merg…
BoBiene Jul 16, 2021
4450a6b
Update docker-image.yml
BoBiene Jul 16, 2021
050721f
Update docker-image.yml
BoBiene Jul 16, 2021
c5f7290
Update docker-image.yml
BoBiene Jul 16, 2021
c200a56
Update docker-image.yml
BoBiene Jul 16, 2021
ce8d8be
Update docker-image.yml
BoBiene Jul 16, 2021
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
39 changes: 39 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docker Image CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- name: Get the tags version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF##*/}
- name: Get the repo name (lower case)
id: get_repo
uses: ASzc/change-string-case-action@v1
with:
string: ${{ github.repository }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- name: Build and Push Docker Image
uses: docker/build-push-action@v2
with:
push: true # Will only build if this is not here
file: server/src/MergeBot/Dockerfile
context: server/
tags: |
ghcr.io/${{ steps.get_repo.outputs.lowercase }}:${{ steps.get_version.outputs.VERSION }}
ghcr.io/${{ steps.get_repo.outputs.lowercase }}:latest
60 changes: 30 additions & 30 deletions client/azdo-merge-bot/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions server/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
21 changes: 21 additions & 0 deletions server/src/MergeBot/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:3.1 AS build
WORKDIR /src
COPY ["src/MergeBot/MergeBot.csproj", "src/MergeBot/"]
RUN dotnet restore "src/MergeBot/MergeBot.csproj"
COPY . .
WORKDIR "/src/src/MergeBot"
RUN dotnet build "MergeBot.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "MergeBot.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "MergeBot.dll"]
11 changes: 7 additions & 4 deletions server/src/MergeBot/MergeBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<Nullable>enable</Nullable>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..</DockerfileContext>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.4" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.17" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.14" />
<PackageReference Include="Semver" Version="2.0.6" />
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.4.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0" />
</ItemGroup>

</Project>
18 changes: 12 additions & 6 deletions server/src/MergeBot/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:29088",
"sslPort": 0
Expand All @@ -18,10 +18,16 @@
"MergeBot": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"applicationUrl": "http://localhost:5000"
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"publishAllPorts": true
}
}
}
}