🚧 add new Dockerfile
continuous-integration/drone/push Build is failing Details

pull/2/head
Maxence LANONE 2 years ago
parent 04b96d8bf4
commit 9fbe2ab77a

@ -1,25 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/Dockerfile
**/bin
**/charts
**/docker-compose*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
**/.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

@ -26,11 +26,10 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiLol", "WebApiLol\WebApiLol.csproj", "{DAE3B5A2-8904-43AE-8459-ED64C3366FDF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{73142960-0D40-4766-973B-37094F4BD879}"
ProjectSection(SolutionItems) = preProject
Dockerfile = Dockerfile
EndProjectSection
EndProject
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "ConsoleTestapi", "Tests\ConsoleTestapi\ConsoleTestapi.csproj", "{EA884D64-6425-46FB-BA25-E2EB8FE6BECE}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleTestapi", "Tests\ConsoleTestapi\ConsoleTestapi.csproj", "{EA884D64-6425-46FB-BA25-E2EB8FE6BECE}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{1B81A541-7D10-4603-B5A2-94108954D831}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -78,6 +77,10 @@ Global
{EA884D64-6425-46FB-BA25-E2EB8FE6BECE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA884D64-6425-46FB-BA25-E2EB8FE6BECE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA884D64-6425-46FB-BA25-E2EB8FE6BECE}.Release|Any CPU.Build.0 = Release|Any CPU
{1B81A541-7D10-4603-B5A2-94108954D831}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B81A541-7D10-4603-B5A2-94108954D831}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B81A541-7D10-4603-B5A2-94108954D831}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B81A541-7D10-4603-B5A2-94108954D831}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -0,0 +1,25 @@
#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:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["WebApiLol/WebApiLol.csproj", "WebApiLol/"]
COPY ["Model/Model.csproj", "Model/"]
COPY ["Shared/Shared.csproj", "Shared/"]
COPY ["StubLib/StubLib.csproj", "StubLib/"]
RUN dotnet restore "WebApiLol/WebApiLol.csproj"
COPY . .
WORKDIR "/src/WebApiLol"
RUN dotnet build "WebApiLol.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "WebApiLol.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WebApiLol.dll"]

@ -1,14 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk" DefaultTargets="Build">
<PropertyGroup Label="Globals">
<ProjectVersion>2.1</ProjectVersion>
<DockerTargetOS>Linux</DockerTargetOS>
<ProjectGuid>{1B81A541-7D10-4603-B5A2-94108954D831}</ProjectGuid>
<DockerLaunchBrowser>True</DockerLaunchBrowser>
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}/swagger</DockerServiceUrl>
<DockerServiceName>webapilol</DockerServiceName>
</PropertyGroup>
<ItemGroup>
<None Include="docker-compose.override.yml">
<DependentUpon>docker-compose.yml</DependentUpon>
</None>
<None Include="docker-compose.yml" />
<None Include="docker-compose.yml" />
<None Include=".dockerignore" />
</ItemGroup>
</Project>
Loading…
Cancel
Save