diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3729ff0 --- /dev/null +++ b/.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/Squirrowse.Client/Program.cs b/Squirrowse.Client/Program.cs index 2d8bf2f..2498c3d 100644 --- a/Squirrowse.Client/Program.cs +++ b/Squirrowse.Client/Program.cs @@ -1,7 +1,6 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Squirrowse.Client.Service; -using Squirrowse.Core.Services; namespace Squirrowse.Client { @@ -18,10 +17,10 @@ namespace Squirrowse.Client .ConfigureServices((hostContext, services) => { services.AddHostedService(); - services.AddSingleton(x => - new ConnectionManager("http://localhost", 5000)); //keep as transient for now - services.AddSingleton(x => new CameraService(new Camera())); - services.AddSingleton(); + services.AddSingleton(x=> new ConnectionManager("http://localhost", 44366)); //keep as transient for now + services.AddSingleton< ICameraService, CameraService >(x=>new CameraService(new Camera())); + services.AddTransient(); + }); } } diff --git a/Squirrowse.Service/Dockerfile b/Squirrowse.Service/Dockerfile new file mode 100644 index 0000000..fcba618 --- /dev/null +++ b/Squirrowse.Service/Dockerfile @@ -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"] \ No newline at end of file diff --git a/Squirrowse.Service/Properties/launchSettings.json b/Squirrowse.Service/Properties/launchSettings.json index 0881dee..67caf15 100644 --- a/Squirrowse.Service/Properties/launchSettings.json +++ b/Squirrowse.Service/Properties/launchSettings.json @@ -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": false, "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 } } } \ No newline at end of file diff --git a/Squirrowse.Service/Squirrowse.Service.csproj b/Squirrowse.Service/Squirrowse.Service.csproj index f71139e..7df21da 100644 --- a/Squirrowse.Service/Squirrowse.Service.csproj +++ b/Squirrowse.Service/Squirrowse.Service.csproj @@ -2,19 +2,10 @@ netcoreapp3.0 - Squirrowse.Service.Program + 996aee3a-63a2-4e6b-abcd-b0c6a183af8c + Linux - - - - - - - PreserveNewest - - - @@ -24,6 +15,7 @@ + @@ -33,10 +25,4 @@ - - - Always - - - \ No newline at end of file