Skip to content

Commit

Permalink
VIH-7409 docker gitversion and healthcheck route change (#357)
Browse files Browse the repository at this point in the history
* docker gitversion and healthcheck route change

* copy the assembly info file

* cleaned up config providers

Co-authored-by: Levi <[email protected]>
  • Loading branch information
levibutler and Levi authored Mar 4, 2021
1 parent 34e2bb4 commit ccd3f82
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 19 deletions.
1 change: 0 additions & 1 deletion VideoApi/.dockerignore → .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
Expand Down
4 changes: 2 additions & 2 deletions VideoApi/VideoApi/Controllers/HealthCheckController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
namespace VideoApi.Controllers
{
[Produces("application/json")]
[Route("HealthCheck")]
[AllowAnonymous]
[ApiController]
public class HealthCheckController : ControllerBase
Expand All @@ -38,7 +37,8 @@ public HealthCheckController(IQueryHandler queryHandler, IVideoPlatformService v
/// Check Service Health
/// </summary>
/// <returns>Error if fails, otherwise OK status</returns>
[HttpGet("health")]
[HttpGet("HealthCheck/health")]
[HttpGet("health/liveness")]
[OpenApiOperation("CheckServiceHealth")]
[ProducesResponseType(typeof(HealthCheckResponse), (int)HttpStatusCode.OK)]
[ProducesResponseType(typeof(HealthCheckResponse), (int)HttpStatusCode.InternalServerError)]
Expand Down
17 changes: 7 additions & 10 deletions VideoApi/VideoApi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM gittools/gitversion:5.3.5-linux-alpine.3.10-x64-netcoreapp3.1 AS gitversion
WORKDIR /version
COPY .git .git
RUN /tools/dotnet-gitversion /ensureassemblyinfo /updateassemblyinfo AssemblyInfo.cs /nofetch /config /GitVersion.yml

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["VideoApi/VideoApi.csproj", "VideoApi/"]
COPY ["VideoApi.Common/VideoApi.Common.csproj", "VideoApi.Common/"]
COPY ["VideoApi.Contract/VideoApi.Contract.csproj", "VideoApi.Contract/"]
COPY ["VideoApi.Domain/VideoApi.Domain.csproj", "VideoApi.Domain/"]
COPY ["VideoApi.Services/VideoApi.Services.csproj", "VideoApi.Services/"]
COPY ["VideoApi.Services.Generator/VideoApi.Services.Generator.csproj", "VideoApi.Services.Generator/"]
COPY ["VideoApi.DAL/VideoApi.DAL.csproj", "VideoApi.DAL/"]
COPY ["VideoApi.Events/VideoApi.Events.csproj", "VideoApi.Events/"]
COPY ["nuget.config", "nuget.config"]
COPY VideoApi .
RUN dotnet restore --configfile nuget.config "VideoApi/VideoApi.csproj"
COPY . .
WORKDIR "/src/VideoApi"
COPY --from=gitversion /version/AssemblyInfo.cs .
RUN dotnet build "VideoApi.csproj" -c Release -o /app/build

FROM build AS publish
Expand Down
5 changes: 0 additions & 5 deletions VideoApi/VideoApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public static IHostBuilder CreateHostBuilder(string[] args)
webBuilder.UseContentRoot(Directory.GetCurrentDirectory());
webBuilder.UseIISIntegration();
webBuilder.UseStartup<Startup>();
webBuilder.ConfigureAppConfiguration(configBuilder =>
{
configBuilder.AddAksKeyVaultSecretProvider(vhInfraCore);
configBuilder.AddAksKeyVaultSecretProvider(vhVideoApi);
});
});
}
}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion VideoApi/docker-compose.yml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ services:
image: ${DOCKER_REGISTRY-}videoapi:latest
build:
context: .
dockerfile: VideoApi/Dockerfile
dockerfile: VideoApi/VideoApi/Dockerfile

0 comments on commit ccd3f82

Please sign in to comment.