Skip to content

Commit

Permalink
add dockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
oneheed committed Jun 5, 2023
1 parent d567180 commit 3358676
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 14 deletions.
25 changes: 25 additions & 0 deletions .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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

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

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["src/InterfaceAdapter/Wsa.Gaas.GobbletGobblers.Core.WebApi/Wsa.Gaas.GobbletGobblers.Core.WebApi.csproj", "src/InterfaceAdapter/Wsa.Gaas.GobbletGobblers.Core.WebApi/"]
COPY ["src/Application/Wsa.Gaas.GobbletGobblers.Application/Wsa.Gaas.GobbletGobblers.Application.csproj", "src/Application/Wsa.Gaas.GobbletGobblers.Application/"]
COPY ["src/Domain/Wsa.Gaas.GobbletGobblers.Domain/Wsa.Gaas.GobbletGobblers.Domain.csproj", "src/Domain/Wsa.Gaas.GobbletGobblers.Domain/"]
RUN dotnet restore "src/InterfaceAdapter/Wsa.Gaas.GobbletGobblers.Core.WebApi/Wsa.Gaas.GobbletGobblers.Core.WebApi.csproj"
COPY . .
WORKDIR "/src/src/InterfaceAdapter/Wsa.Gaas.GobbletGobblers.Core.WebApi"
RUN dotnet build "Wsa.Gaas.GobbletGobblers.Core.WebApi.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Wsa.Gaas.GobbletGobblers.Core.WebApi.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Wsa.Gaas.GobbletGobblers.Core.WebApi.dll"]
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:48696",
"sslPort": 44322
}
},
{
"profiles": {
"Wsa.Gaas.GobbletGobblers.WebApi": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7227;http://localhost:5075",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7227;http://localhost:5075"
},
"IIS Express": {
"commandName": "IISExpress",
Expand All @@ -26,6 +17,22 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
"publishAllPorts": true,
"useSSL": false
}
},
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:48696",
"sslPort": 44322
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>0ebaa4f1-5d5a-4294-b40d-56f2113cf1ce</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerfileContext>..\..\..</DockerfileContext>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>

Expand Down

0 comments on commit 3358676

Please sign in to comment.