mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add vs docker toolilng to API
This commit is contained in:
parent
bea6d0dafe
commit
4347d77c4d
9 changed files with 72 additions and 53 deletions
|
|
@ -1,18 +1,19 @@
|
|||
.env
|
||||
**/.git
|
||||
**/.github
|
||||
.gitattributes
|
||||
.gitignore
|
||||
**/.github
|
||||
**/.vs
|
||||
**/.vscode
|
||||
**/images
|
||||
**/ops
|
||||
codecov.yml
|
||||
.dockerignore
|
||||
docker-compose.yml
|
||||
docker-compose.*.yml
|
||||
FilterLists.sln
|
||||
*.DotSettings*
|
||||
LICENSE
|
||||
docker-compose.dcproj
|
||||
**/bin
|
||||
**/obj
|
||||
**/node_modules
|
||||
**/.sln
|
||||
**/node_modules
|
||||
*.DotSettings*
|
||||
LICENSE
|
||||
**/images
|
||||
**/ops
|
||||
|
|
@ -39,6 +39,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{CE4AB25B-550
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{041F9CFA-B6F7-4DEB-9441-829DE697B1BB}"
|
||||
EndProject
|
||||
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{B94A5BCD-3BE3-4FE4-AE48-ADCF904A22A4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -73,6 +75,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
|
||||
{B94A5BCD-3BE3-4FE4-AE48-ADCF904A22A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B94A5BCD-3BE3-4FE4-AE48-ADCF904A22A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B94A5BCD-3BE3-4FE4-AE48-ADCF904A22A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B94A5BCD-3BE3-4FE4-AE48-ADCF904A22A4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
|||
|
|
@ -1,8 +0,0 @@
|
|||
coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
enabled: no
|
||||
patch:
|
||||
default:
|
||||
enabled: no
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
# For running data integration tests in FilterLists.Data.Tests
|
||||
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
17
docker-compose.dcproj
Normal file
17
docker-compose.dcproj
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?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>b94a5bcd-3be3-4fe4-ae48-adcf904a22a4</ProjectGuid>
|
||||
<DockerLaunchAction>LaunchBrowser</DockerLaunchAction>
|
||||
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}</DockerServiceUrl>
|
||||
<DockerServiceName>filterlists.api</DockerServiceName>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include="docker-compose.prod.yml" />
|
||||
<None Include="docker-compose.data.tests.yml" />
|
||||
<None Include="docker-compose.yml" />
|
||||
<None Include=".dockerignore" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
# For running pre-build instances of all modules from Hub
|
||||
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
|
||||
FilterLists.Api:
|
||||
api:
|
||||
image: collinbarrett/filterlists.api:latest
|
||||
|
||||
FilterLists.Web:
|
||||
web:
|
||||
image: collinbarrett/filterlists.web:latest
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
# For building and running all modules
|
||||
|
||||
version: "3.7"
|
||||
|
||||
services:
|
||||
|
|
|
|||
|
|
@ -1,56 +1,64 @@
|
|||
# Context: .
|
||||
# Command: docker build -f src/FilterLists.Api/Dockerfile .
|
||||
|
||||
# prep runtime
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-alpine as runtime
|
||||
ENTRYPOINT ["dotnet", "FilterLists.Api.dll"]
|
||||
# init base
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-alpine as base
|
||||
ENV DataDirectory__Path "data"
|
||||
ENV ASPNETCORE_URLS "http://*:5000"
|
||||
EXPOSE 5000
|
||||
ENTRYPOINT ["dotnet", "FilterLists.Api.dll"]
|
||||
|
||||
# init build
|
||||
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine AS build
|
||||
|
||||
# restore
|
||||
WORKDIR /src/
|
||||
COPY src/FilterLists.Data/FilterLists.Data.csproj ./FilterLists.Data/
|
||||
COPY src/FilterLists.Services/FilterLists.Services.csproj ./FilterLists.Services/
|
||||
WORKDIR /src/FilterLists.Api/
|
||||
COPY src/FilterLists.Api/FilterLists.Api.csproj ./
|
||||
WORKDIR /src
|
||||
COPY src/FilterLists.Data/FilterLists.Data.csproj FilterLists.Data/
|
||||
COPY src/FilterLists.Services/FilterLists.Services.csproj FilterLists.Services/
|
||||
WORKDIR /src/FilterLists.Api
|
||||
COPY src/FilterLists.Api/FilterLists.Api.csproj .
|
||||
RUN dotnet restore
|
||||
|
||||
# build
|
||||
WORKDIR /src/
|
||||
COPY src/FilterLists.Data/. ./FilterLists.Data/
|
||||
COPY src/FilterLists.Services/. ./FilterLists.Services/
|
||||
WORKDIR /src/FilterLists.Api/
|
||||
COPY src/FilterLists.Api/. ./
|
||||
WORKDIR /src
|
||||
COPY src/FilterLists.Data/. FilterLists.Data/
|
||||
COPY src/FilterLists.Services/. FilterLists.Services/
|
||||
WORKDIR /src/FilterLists.Api
|
||||
COPY src/FilterLists.Api/. .
|
||||
RUN dotnet build -c Release --no-restore
|
||||
|
||||
# build data tests
|
||||
# init Data.Tests
|
||||
FROM build AS test-data
|
||||
WORKDIR /tests/FilterLists.Data.Tests/
|
||||
COPY tests/FilterLists.Data.Tests/FilterLists.Data.Tests.csproj ./
|
||||
RUN dotnet restore
|
||||
COPY tests/FilterLists.Data.Tests/. ./
|
||||
RUN dotnet build -c Release --no-restore
|
||||
COPY data/. ./data/
|
||||
ENTRYPOINT ["dotnet", "test"]
|
||||
|
||||
# build services tests
|
||||
FROM build AS test-services
|
||||
WORKDIR /tests/FilterLists.Services.Tests/
|
||||
COPY tests/FilterLists.Services.Tests/FilterLists.Services.Tests.csproj ./
|
||||
# restore Data.Tests
|
||||
WORKDIR /tests/FilterLists.Data.Tests
|
||||
COPY tests/FilterLists.Data.Tests/FilterLists.Data.Tests.csproj .
|
||||
RUN dotnet restore
|
||||
COPY tests/FilterLists.Services.Tests/. ./
|
||||
|
||||
# build Data.Tests
|
||||
COPY tests/FilterLists.Data.Tests/. .
|
||||
RUN dotnet build -c Release --no-restore
|
||||
COPY data/. data/
|
||||
|
||||
# init Services.Tests
|
||||
FROM build AS test-services
|
||||
ENTRYPOINT ["dotnet", "test"]
|
||||
|
||||
# restore Services.Tests
|
||||
WORKDIR /tests/FilterLists.Services.Tests
|
||||
COPY tests/FilterLists.Services.Tests/FilterLists.Services.Tests.csproj .
|
||||
RUN dotnet restore
|
||||
|
||||
# build Services.Tests
|
||||
COPY tests/FilterLists.Services.Tests/. .
|
||||
RUN dotnet build -c Release --no-restore
|
||||
|
||||
# publish
|
||||
FROM build AS publish
|
||||
RUN dotnet publish -c Release -o out --no-restore --no-build
|
||||
|
||||
# run
|
||||
FROM runtime as final
|
||||
COPY --from=publish /src/FilterLists.Api/out ./
|
||||
COPY data/. ./data/
|
||||
# final
|
||||
FROM base as final
|
||||
COPY --from=publish /src/FilterLists.Api/out .
|
||||
COPY data/. data/
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
<RepositoryUrl>https://github.com/collinbarrett/FilterLists</RepositoryUrl>
|
||||
<ServerGarbageCollection>false</ServerGarbageCollection>
|
||||
<OutputType>Exe</OutputType>
|
||||
<DockerComposeProjectPath>..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
Loading…
Reference in a new issue