diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fe1152b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +**/.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 +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/DagoniteEmpire/DagoniteEmpire.csproj b/DagoniteEmpire/DagoniteEmpire.csproj index d83fc62..fca7210 100644 --- a/DagoniteEmpire/DagoniteEmpire.csproj +++ b/DagoniteEmpire/DagoniteEmpire.csproj @@ -4,6 +4,8 @@ net7.0 enable enable + 9a3c55b2-09c2-4342-8905-6c957b9faa98 + Linux @@ -30,6 +32,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/DagoniteEmpire/Dockerfile b/DagoniteEmpire/Dockerfile new file mode 100644 index 0000000..cde7bca --- /dev/null +++ b/DagoniteEmpire/Dockerfile @@ -0,0 +1,26 @@ +FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["DagoniteEmpire/DagoniteEmpire.csproj", "DagoniteEmpire/"] +COPY ["DA_Business/DA_Business.csproj", "DA_Business/"] +COPY ["DA_Models/DA_Models.csproj", "DA_Models/"] +COPY ["DA_DataAccess/DA_DataAccess.csproj", "DA_DataAccess/"] +COPY ["DA_Common/DA_Common.csproj", "DA_Common/"] +RUN dotnet restore "./DagoniteEmpire/DagoniteEmpire.csproj" +COPY . . +WORKDIR "/src/DagoniteEmpire" +RUN dotnet build "./DagoniteEmpire.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./DagoniteEmpire.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "DagoniteEmpire.dll"] \ No newline at end of file diff --git a/DagoniteEmpire/Properties/launchSettings.json b/DagoniteEmpire/Properties/launchSettings.json index 4257c87..34f3777 100644 --- a/DagoniteEmpire/Properties/launchSettings.json +++ b/DagoniteEmpire/Properties/launchSettings.json @@ -1,28 +1,22 @@ { - "iisSettings": { - "iisExpress": { - "applicationUrl": "http://localhost:10743", - "sslPort": 44393 - } - }, "profiles": { "http": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, - "applicationUrl": "http://localhost:5093", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "http://localhost:5093" }, "https": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, - "applicationUrl": "https://localhost:7282;http://localhost:5093", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:7282;http://localhost:5093" }, "IIS Express": { "commandName": "IISExpress", @@ -30,6 +24,24 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_URLS": "https://+:443;http://+:80" + }, + "publishAllPorts": true, + "useSSL": true + } + }, + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:10743", + "sslPort": 44393 } } -} +} \ No newline at end of file