add docker file
continuous-integration/drone/push Build is failing Details

pull/2/head
Maxence LANONE 2 years ago
parent e32e9d7113
commit 5bd63ce5a4

@ -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

@ -1,10 +1,11 @@
<Properties GitUserInfo="UsingGIT" StartupConfiguration="{DAE3B5A2-8904-43AE-8459-ED64C3366FDF}|https">
<Properties GitUserInfo="UsingGIT" StartupConfiguration="{23AC6E45-406F-4320-B951-3B59DB10988C}|Default">
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
<MonoDevelop.Ide.DebuggingService.Breakpoints>
<BreakpointStore />
</MonoDevelop.Ide.DebuggingService.Breakpoints>
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
<MonoDevelop.Ide.ItemProperties.Tests.TestUnitaireLOL PreferredExecutionTarget="MonoDevelop.Default" />
<MonoDevelop.Ide.ItemProperties.docker-compose PreferredExecutionTarget="MonoDevelop.Default" />
<MonoDevelop.Ide.ItemProperties.Tests.ConsoleTests PreferredExecutionTarget="MonoDevelop.Default" />
<MonoDevelop.Ide.ItemProperties.DbDatamanager FirstBuild="True" />
<DisabledProjects>
@ -14,7 +15,6 @@
<MultiItemStartupConfigurations>
<MultiItemSolutionRunConfiguration Id="Api" Name="Api">
<Items>
<StartupItem ItemId="{9F0D695A-3E93-40A5-9D4E-22A144757393}" ItemName="ConsoleTestapi" />
<StartupItem ItemId="{DAE3B5A2-8904-43AE-8459-ED64C3366FDF}" ItemName="WebApiLol" ConfigurationId="https" />
</Items>
</MultiItemSolutionRunConfiguration>

@ -25,7 +25,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EntityFrameWorkLib", "Entit
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApiLol", "WebApiLol\WebApiLol.csproj", "{DAE3B5A2-8904-43AE-8459-ED64C3366FDF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleTestapi", "Tests\ConsoleTestapi\ConsoleTestapi.csproj", "{9F0D695A-3E93-40A5-9D4E-22A144757393}"
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "ConsoleTestapi", "Tests\ConsoleTestapi\ConsoleTestapi.csproj", "{95E32251-0B03-4233-B9FF-5D5F1F618833}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{23AC6E45-406F-4320-B951-3B59DB10988C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -69,10 +71,14 @@ Global
{DAE3B5A2-8904-43AE-8459-ED64C3366FDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DAE3B5A2-8904-43AE-8459-ED64C3366FDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DAE3B5A2-8904-43AE-8459-ED64C3366FDF}.Release|Any CPU.Build.0 = Release|Any CPU
{9F0D695A-3E93-40A5-9D4E-22A144757393}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9F0D695A-3E93-40A5-9D4E-22A144757393}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9F0D695A-3E93-40A5-9D4E-22A144757393}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9F0D695A-3E93-40A5-9D4E-22A144757393}.Release|Any CPU.Build.0 = Release|Any CPU
{95E32251-0B03-4233-B9FF-5D5F1F618833}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{95E32251-0B03-4233-B9FF-5D5F1F618833}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95E32251-0B03-4233-B9FF-5D5F1F618833}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95E32251-0B03-4233-B9FF-5D5F1F618833}.Release|Any CPU.Build.0 = Release|Any CPU
{23AC6E45-406F-4320-B951-3B59DB10988C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{23AC6E45-406F-4320-B951-3B59DB10988C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{23AC6E45-406F-4320-B951-3B59DB10988C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{23AC6E45-406F-4320-B951-3B59DB10988C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -85,6 +91,6 @@ Global
{B01D7EF2-2D64-409A-A29A-61FB7BB7A9DB} = {2C607793-B163-4731-A4D1-AFE8A7C4C170}
{3E16421B-7372-477D-A25E-8249D5203A1E} = {C76D0C23-1FFA-4963-93CD-E12BD643F030}
{F4473EB6-6CD7-4A73-89BC-82C247A23412} = {C76D0C23-1FFA-4963-93CD-E12BD643F030}
{9F0D695A-3E93-40A5-9D4E-22A144757393} = {C76D0C23-1FFA-4963-93CD-E12BD643F030}
{95E32251-0B03-4233-B9FF-5D5F1F618833} = {C76D0C23-1FFA-4963-93CD-E12BD643F030}
EndGlobalSection
EndGlobal

@ -0,0 +1,22 @@
#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/"]
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"]

@ -4,6 +4,8 @@
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerComposeProjectPath>../docker-compose.dcproj</DockerComposeProjectPath>
<UserSecretsId>dd7888cb-963f-4be5-85ae-fe318eb51482</UserSecretsId>
</PropertyGroup>
<PropertyGroup Condition=" '$(RunConfiguration)' == 'https' " />

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk" DefaultTargets="Build">
<PropertyGroup Label="Globals">
<ProjectVersion>2.1</ProjectVersion>
<DockerTargetOS>Linux</DockerTargetOS>
<ProjectGuid>{23AC6E45-406F-4320-B951-3B59DB10988C}</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=".dockerignore" />
</ItemGroup>
</Project>

@ -0,0 +1,13 @@
version: '3.4'
services:
webapilol:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=https://+:443;http://+:80
ports:
- "80"
- "443"
volumes:
- ~/.aspnet/https:/root/.aspnet/https:ro
- ~/.microsoft/usersecrets:/root/.microsoft/usersecrets:ro

@ -0,0 +1,8 @@
version: '3.4'
services:
webapilol:
image: ${DOCKER_REGISTRY-}webapilol
build:
context: .
dockerfile: WebApiLol/Dockerfile
Loading…
Cancel
Save