add dockerfiles

This commit is contained in:
danielgrabowski 2019-11-05 13:01:38 +01:00
parent ff77cbbe1d
commit 0b3b898ccf
5 changed files with 66 additions and 7 deletions

25
.dockerignore Normal file
View File

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

View File

@ -17,7 +17,7 @@ namespace Squirrowse.Client
.ConfigureServices((hostContext, services) =>
{
services.AddHostedService<Worker>();
services.AddSingleton<IConnectionManager>(x=> new ConnectionManager("http://localhost", 5000)); //keep as transient for now
services.AddSingleton<IConnectionManager>(x=> new ConnectionManager("http://localhost", 44366)); //keep as transient for now
services.AddSingleton< ICameraService, CameraService >(x=>new CameraService(new Camera()));
services.AddTransient<IStreamService, StreamService>();

View File

@ -0,0 +1,21 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
WORKDIR /app
EXPOSE 5000
EXPOSE 5001
FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src
COPY ["Squirrowse.Service/Squirrowse.Service.csproj", "Squirrowse.Service/"]
COPY ["Squirrowse.Core/Squirrowse.Core.csproj", "Squirrowse.Core/"]
RUN dotnet restore "Squirrowse.Service/Squirrowse.Service.csproj"
COPY . .
WORKDIR "/src/Squirrowse.Service"
RUN dotnet build "Squirrowse.Service.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Squirrowse.Service.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Squirrowse.Service.dll"]

View File

@ -1,5 +1,4 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
@ -8,11 +7,10 @@
"sslPort": 44365
}
},
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": false,
"launchUrl": "",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
@ -21,10 +19,22 @@
"commandName": "Project",
"launchBrowser": true,
"launchUrl": "weatherforecast",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"applicationUrl": "https://localhost:5001;http://localhost:5000"
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"environmentVariables": {
"ASPNETCORE_URLS": "https://+:443;http://+:80",
"ASPNETCORE_HTTPS_PORT": "44366"
},
"httpPort": 59338,
"useSSL": true,
"sslPort": 44366
}
}
}

View File

@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<UserSecretsId>996aee3a-63a2-4e6b-abcd-b0c6a183af8c</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
@ -13,6 +15,7 @@
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="3.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="3.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.5" />
<PackageReference Include="NLog.Web.AspNetCore" Version="4.9.0" />
<PackageReference Include="System.Reactive.Linq" Version="4.0.0" />
<PackageReference Include="OpenCvSharp4.Windows" Version="4.1.1.20191021" />