From 05ce84a07afdbd60280d143b5cf05700c2393cd4 Mon Sep 17 00:00:00 2001 From: Giacomo Date: Fri, 7 Sep 2018 16:39:06 +0200 Subject: [PATCH] Aggiungere i file di progetto. --- .dockerignore | 9 +++++ SeniorAssistant.sln | 25 ++++++++++++++ SeniorAssistant/Dockerfile | 23 +++++++++++++ SeniorAssistant/Program.cs | 24 +++++++++++++ .../Properties/launchSettings.json | 32 +++++++++++++++++ SeniorAssistant/SeniorAssistant.csproj | 17 ++++++++++ SeniorAssistant/Startup.cs | 34 +++++++++++++++++++ 7 files changed, 164 insertions(+) create mode 100644 .dockerignore create mode 100644 SeniorAssistant.sln create mode 100644 SeniorAssistant/Dockerfile create mode 100644 SeniorAssistant/Program.cs create mode 100644 SeniorAssistant/Properties/launchSettings.json create mode 100644 SeniorAssistant/SeniorAssistant.csproj create mode 100644 SeniorAssistant/Startup.cs diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..df2e0fe --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.dockerignore +.env +.git +.gitignore +.vs +.vscode +*/bin +*/obj +**/.toolstarget \ No newline at end of file diff --git a/SeniorAssistant.sln b/SeniorAssistant.sln new file mode 100644 index 0000000..d307d64 --- /dev/null +++ b/SeniorAssistant.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28010.2019 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeniorAssistant", "SeniorAssistant\SeniorAssistant.csproj", "{B40911C2-EC1B-470E-A9C0-A07F19B7E165}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B40911C2-EC1B-470E-A9C0-A07F19B7E165}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B40911C2-EC1B-470E-A9C0-A07F19B7E165}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B40911C2-EC1B-470E-A9C0-A07F19B7E165}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B40911C2-EC1B-470E-A9C0-A07F19B7E165}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D1B29BAD-8DBC-4DAB-B61C-8B20B5C5348E} + EndGlobalSection +EndGlobal diff --git a/SeniorAssistant/Dockerfile b/SeniorAssistant/Dockerfile new file mode 100644 index 0000000..578308f --- /dev/null +++ b/SeniorAssistant/Dockerfile @@ -0,0 +1,23 @@ +#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed. +#For more information, please see https://aka.ms/containercompat + +FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1803 AS base +WORKDIR /app +EXPOSE 50361 +EXPOSE 44348 + +FROM microsoft/dotnet:2.1-sdk-nanoserver-1803 AS build +WORKDIR /src +COPY ["SeniorAssistant/SeniorAssistant.csproj", "SeniorAssistant/"] +RUN dotnet restore "SeniorAssistant/SeniorAssistant.csproj" +COPY . . +WORKDIR "/src/SeniorAssistant" +RUN dotnet build "SeniorAssistant.csproj" -c Release -o /app + +FROM build AS publish +RUN dotnet publish "SeniorAssistant.csproj" -c Release -o /app + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "SeniorAssistant.dll"] \ No newline at end of file diff --git a/SeniorAssistant/Program.cs b/SeniorAssistant/Program.cs new file mode 100644 index 0000000..a0907b3 --- /dev/null +++ b/SeniorAssistant/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace SeniorAssistant +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/SeniorAssistant/Properties/launchSettings.json b/SeniorAssistant/Properties/launchSettings.json new file mode 100644 index 0000000..76fa1f6 --- /dev/null +++ b/SeniorAssistant/Properties/launchSettings.json @@ -0,0 +1,32 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50361", + "sslPort": 44348 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "SeniorAssistant": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}" + } + } +} \ No newline at end of file diff --git a/SeniorAssistant/SeniorAssistant.csproj b/SeniorAssistant/SeniorAssistant.csproj new file mode 100644 index 0000000..f0e4cf7 --- /dev/null +++ b/SeniorAssistant/SeniorAssistant.csproj @@ -0,0 +1,17 @@ + + + + netcoreapp2.1 + Windows + 7506fc54-8ed1-4c9b-9004-35d36db99964 + + + + + + + + + + + diff --git a/SeniorAssistant/Startup.cs b/SeniorAssistant/Startup.cs new file mode 100644 index 0000000..3e50b93 --- /dev/null +++ b/SeniorAssistant/Startup.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; + +namespace SeniorAssistant +{ + public class Startup + { + // This method gets called by the runtime. Use this method to add services to the container. + // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 + public void ConfigureServices(IServiceCollection services) + { + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.Run(async (context) => + { + await context.Response.WriteAsync("Hello World!"); + }); + } + } +}