Skip to content

Commit

Permalink
Add Docker support
Browse files Browse the repository at this point in the history
  • Loading branch information
qJake committed Aug 31, 2019
1 parent b49b74a commit 110e8d0
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.vs
**/.vscode
**/*.*proj.user
**/azds.yaml
**/charts
**/bin
**/obj
**/Dockerfile
**/Dockerfile.develop
**/docker-compose.yml
**/docker-compose.*.yml
**/*.dbmdl
**/*.jfm
**/secrets.dev.yaml
**/values.dev.yaml
**/.toolstarget
23 changes: 23 additions & 0 deletions HADotNet.CommandCenter/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base
WORKDIR /app
EXPOSE 8095

FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build
WORKDIR /src
COPY ["HADotNet.CommandCenter/HADotNet.CommandCenter.csproj", "HADotNet.CommandCenter/"]
RUN dotnet restore "HADotNet.CommandCenter/HADotNet.CommandCenter.csproj"
COPY . .
WORKDIR "/src/HADotNet.CommandCenter"
RUN dotnet build "HADotNet.CommandCenter.csproj" -c Release -o /app

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

FROM base AS final
WORKDIR /app
COPY --from=publish /app .

ENV ASPNETCORE_URLS http://*:8095
ENV ASPNETCORE_ENVIRONMENT Production

ENTRYPOINT ["dotnet", "HADotNet.CommandCenter.dll"]
2 changes: 2 additions & 0 deletions HADotNet.CommandCenter/HADotNet.CommandCenter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RuntimeIdentifiers>win10;alpine.3.10-x64</RuntimeIdentifiers>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -55,6 +56,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.7.9" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Quartz" Version="3.0.7" />
</ItemGroup>
Expand Down
7 changes: 7 additions & 0 deletions HADotNet.CommandCenter/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:5000"
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/admin",
"environmentVariables": {},
"httpPort": 60663
}
}
}

0 comments on commit 110e8d0

Please sign in to comment.