diff --git a/Sources/.dockerignore b/Sources/.dockerignore new file mode 100644 index 0000000..bdca33b --- /dev/null +++ b/Sources/.dockerignore @@ -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 \ No newline at end of file diff --git a/Sources/Tests/DbConsole/projet.Champions.db-shm b/Sources/Tests/DbConsole/projet.Champions.db-shm deleted file mode 100644 index fe9ac28..0000000 Binary files a/Sources/Tests/DbConsole/projet.Champions.db-shm and /dev/null differ diff --git a/Sources/Tests/DbConsole/projet.Champions.db-wal b/Sources/Tests/DbConsole/projet.Champions.db-wal deleted file mode 100644 index e69de29..0000000 diff --git a/Sources/Trek12_API.sln b/Sources/Trek12_API.sln index d29939e..c682d4f 100644 --- a/Sources/Trek12_API.sln +++ b/Sources/Trek12_API.sln @@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stub", "Stub\Stub\Stub.cspr EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared", "Shared\Shared.csproj", "{8B6EC777-57F8-4509-9163-4312A40FE63C}" EndProject +Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{7DF17583-2166-4ABE-82EE-F63CEE2132C2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -55,6 +57,10 @@ Global {8B6EC777-57F8-4509-9163-4312A40FE63C}.Debug|Any CPU.Build.0 = Debug|Any CPU {8B6EC777-57F8-4509-9163-4312A40FE63C}.Release|Any CPU.ActiveCfg = Release|Any CPU {8B6EC777-57F8-4509-9163-4312A40FE63C}.Release|Any CPU.Build.0 = Release|Any CPU + {7DF17583-2166-4ABE-82EE-F63CEE2132C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7DF17583-2166-4ABE-82EE-F63CEE2132C2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7DF17583-2166-4ABE-82EE-F63CEE2132C2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7DF17583-2166-4ABE-82EE-F63CEE2132C2}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Sources/Trek12_API/Dockerfile b/Sources/Trek12_API/Dockerfile new file mode 100644 index 0000000..cab2609 --- /dev/null +++ b/Sources/Trek12_API/Dockerfile @@ -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:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["Trek12_API/Trek12_API.csproj", "Trek12_API/"] +COPY ["Stub/Stub/Stub.csproj", "Stub/Stub/"] +COPY ["Model/Model.csproj", "Model/"] +COPY ["Shared/Shared.csproj", "Shared/"] +RUN dotnet restore "Trek12_API/Trek12_API.csproj" +COPY . . +WORKDIR "/src/Trek12_API" +RUN dotnet build "Trek12_API.csproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Trek12_API.csproj" -c Release -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Trek12_API.dll"] diff --git a/Sources/Trek12_API/Trek12_API.csproj b/Sources/Trek12_API/Trek12_API.csproj index e5726d1..009f215 100644 --- a/Sources/Trek12_API/Trek12_API.csproj +++ b/Sources/Trek12_API/Trek12_API.csproj @@ -4,6 +4,8 @@ net6.0 enable enable + ../docker-compose.dcproj + 24549743-d6e0-4694-975a-beb4dc331de3 diff --git a/Sources/docker-compose.dcproj b/Sources/docker-compose.dcproj new file mode 100644 index 0000000..2e6fc8e --- /dev/null +++ b/Sources/docker-compose.dcproj @@ -0,0 +1,18 @@ + + + + 2.1 + Linux + {7DF17583-2166-4ABE-82EE-F63CEE2132C2} + True + {Scheme}://localhost:{ServicePort}/swagger + trek12_api + + + + docker-compose.yml + + + + + diff --git a/Sources/docker-compose.override.yml b/Sources/docker-compose.override.yml new file mode 100644 index 0000000..8584db8 --- /dev/null +++ b/Sources/docker-compose.override.yml @@ -0,0 +1,13 @@ +version: '3.4' + +services: + trek12_api: + 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 \ No newline at end of file diff --git a/Sources/docker-compose.yml b/Sources/docker-compose.yml new file mode 100644 index 0000000..1ebd451 --- /dev/null +++ b/Sources/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3.4' + +services: + trek12_api: + image: ${DOCKER_REGISTRY-}trek12api + build: + context: . + dockerfile: Trek12_API/Dockerfile