mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
initial add docker-compose
This commit is contained in:
parent
fb86300d76
commit
eec8a15ddd
9 changed files with 72 additions and 15 deletions
|
|
@ -4,6 +4,7 @@
|
|||
.gitignore
|
||||
.vs
|
||||
.vscode
|
||||
docker-compose.yml
|
||||
docker-compose.*.yml
|
||||
*/bin
|
||||
*/obj
|
||||
**/.toolstarget
|
||||
|
|
@ -52,6 +52,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FilterLists.Services.Tests"
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FilterLists.Data.Tests", "tests\FilterLists.Data.Tests\FilterLists.Data.Tests.csproj", "{DA34DED7-B352-4855-9C7B-9E3D983DBE2E}"
|
||||
EndProject
|
||||
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{94FF757E-0A78-4E9C-971E-A0709206AC27}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -86,6 +88,10 @@ Global
|
|||
{DA34DED7-B352-4855-9C7B-9E3D983DBE2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DA34DED7-B352-4855-9C7B-9E3D983DBE2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DA34DED7-B352-4855-9C7B-9E3D983DBE2E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{94FF757E-0A78-4E9C-971E-A0709206AC27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{94FF757E-0A78-4E9C-971E-A0709206AC27}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{94FF757E-0A78-4E9C-971E-A0709206AC27}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{94FF757E-0A78-4E9C-971E-A0709206AC27}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
|||
18
docker-compose.dcproj
Normal file
18
docker-compose.dcproj
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectVersion>2.1</ProjectVersion>
|
||||
<DockerTargetOS>Linux</DockerTargetOS>
|
||||
<ProjectGuid>94ff757e-0a78-4e9c-971e-a0709206ac27</ProjectGuid>
|
||||
<DockerLaunchAction>LaunchBrowser</DockerLaunchAction>
|
||||
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}</DockerServiceUrl>
|
||||
<DockerServiceName>filterlists.api</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>
|
||||
15
docker-compose.override.yml
Normal file
15
docker-compose.override.yml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
version: '3.4'
|
||||
|
||||
services:
|
||||
filterlists.api:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
ports:
|
||||
- "80"
|
||||
|
||||
filterlists.web:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
ports:
|
||||
- "80"
|
||||
|
||||
15
docker-compose.yml
Normal file
15
docker-compose.yml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
version: '3.4'
|
||||
|
||||
services:
|
||||
filterlists.api:
|
||||
image: ${DOCKER_REGISTRY-}filterlistsapi
|
||||
build:
|
||||
context: .
|
||||
dockerfile: src/FilterLists.Api/Dockerfile
|
||||
|
||||
filterlists.web:
|
||||
image: ${DOCKER_REGISTRY-}filterlistsweb
|
||||
build:
|
||||
context: .
|
||||
dockerfile: src/FilterLists.Web/Dockerfile
|
||||
|
||||
|
|
@ -4,18 +4,18 @@ EXPOSE 80
|
|||
|
||||
FROM microsoft/dotnet:2.1-sdk AS build
|
||||
WORKDIR /src
|
||||
COPY ["src/FilterLists.Api/FilterLists.Api.csproj", "src/FilterLists.Api/"]
|
||||
COPY ["src/FilterLists.Services/FilterLists.Services.csproj", "src/FilterLists.Services/"]
|
||||
COPY ["src/FilterLists.Data/FilterLists.Data.csproj", "src/FilterLists.Data/"]
|
||||
RUN dotnet restore "src/FilterLists.Api/FilterLists.Api.csproj"
|
||||
COPY src/FilterLists.Api/FilterLists.Api.csproj src/FilterLists.Api/
|
||||
COPY src/FilterLists.Services/FilterLists.Services.csproj src/FilterLists.Services/
|
||||
COPY src/FilterLists.Data/FilterLists.Data.csproj src/FilterLists.Data/
|
||||
RUN dotnet restore src/FilterLists.Api/FilterLists.Api.csproj
|
||||
COPY . .
|
||||
WORKDIR "/src/src/FilterLists.Api"
|
||||
RUN dotnet build "FilterLists.Api.csproj" -c Release -o /app
|
||||
WORKDIR /src/src/FilterLists.Api
|
||||
RUN dotnet build FilterLists.Api.csproj -c Release -o /app
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "FilterLists.Api.csproj" -c Release -o /app
|
||||
RUN dotnet publish FilterLists.Api.csproj -c Release -o /app
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app .
|
||||
ENTRYPOINT ["dotnet", "FilterLists.Api.dll"]
|
||||
ENTRYPOINT ["dotnet", "FilterLists.Api.dll"]
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
<RepositoryUrl>https://github.com/collinbarrett/FilterLists</RepositoryUrl>
|
||||
<ServerGarbageCollection>false</ServerGarbageCollection>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
|
|
|||
|
|
@ -4,16 +4,16 @@ EXPOSE 80
|
|||
|
||||
FROM microsoft/dotnet:2.1-sdk AS build
|
||||
WORKDIR /src
|
||||
COPY ["src/FilterLists.Web/FilterLists.Web.csproj", "src/FilterLists.Web/"]
|
||||
RUN dotnet restore "src/FilterLists.Web/FilterLists.Web.csproj"
|
||||
COPY src/FilterLists.Web/FilterLists.Web.csproj src/FilterLists.Web/
|
||||
RUN dotnet restore src/FilterLists.Web/FilterLists.Web.csproj
|
||||
COPY . .
|
||||
WORKDIR "/src/src/FilterLists.Web"
|
||||
RUN dotnet build "FilterLists.Web.csproj" -c Release -o /app
|
||||
WORKDIR /src/src/FilterLists.Web
|
||||
RUN dotnet build FilterLists.Web.csproj -c Release -o /app
|
||||
|
||||
FROM build AS publish
|
||||
RUN dotnet publish "FilterLists.Web.csproj" -c Release -o /app
|
||||
RUN dotnet publish FilterLists.Web.csproj -c Release -o /app
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app .
|
||||
ENTRYPOINT ["dotnet", "FilterLists.Web.dll"]
|
||||
ENTRYPOINT ["dotnet", "FilterLists.Web.dll"]
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
|
||||
<ServerGarbageCollection>false</ServerGarbageCollection>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Reference in a new issue