Adds docker support for web client app

This commit is contained in:
BinaryAlley committed 2024-11-06 12:20:17 +02:00
1 parent 5e1f0ba4b0
commit 78136fe97c
13 files changed
+135 -37

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
# This stage is used when running from VS in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 5012
EXPOSE 7112
# ==== Stage 1: Build stage
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
# restore NuGet packages (keeping this section separate from the rest of the project files allows Docker to cache the restored packages)
COPY ["AssemblyInfo_Shared.cs", "."]
COPY ["Lumina.Presentation.Web/Lumina.Presentation.Web.csproj", "Lumina.Presentation.Web/"]
RUN dotnet restore "./Lumina.Presentation.Web/Lumina.Presentation.Web.csproj" /p:BaseOutputPath=/app/publish/
# build the project
COPY ["Lumina.Presentation.Web/", "Lumina.Presentation.Web/"]
COPY . .
WORKDIR /src/Lumina.Presentation.Web
RUN dotnet build "./Lumina.Presentation.Web.csproj" -c $BUILD_CONFIGURATION -o /app/build /p:BaseOutputPath=/app/publish/
# ==== Stage 2: Publish stage
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Lumina.Presentation.Web.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false /p:BaseOutputPath=/app/publish/
# ==== Stage 3: Run stage
#FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENV ASPNETCORE_HTTP_PORTS=5012
ENV ASPNETCORE_HTTPS_PORTS=7112
EXPOSE 5012
EXPOSE 7112
ENTRYPOINT ["dotnet", "Lumina.Presentation.Web.dll"]
# to build this Docker image, run the following command from the root of the project (location of the .sln file):
# docker build --no-cache -t lumina-web -f Lumina.Presentation.Web/Dockerfile .
@@ -1,23 +1,31 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
//"launchBrowser": true,
"applicationUrl": "http://localhost:5012",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
//"launchBrowser": true,
"applicationUrl": "http://localhost:5012;https://localhost:7112",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
"profiles": {
"http": {
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5012"
},
"https": {
"commandName": "Project",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "http://localhost:5012;https://localhost:7112"
},
"Container (Dockerfile)": {
"commandName": "Docker",
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
"environmentVariables": {
"ASPNETCORE_HTTPS_PORTS": "7112",
"ASPNETCORE_HTTP_PORTS": "5012"
},
"publishAllPorts": true,
"useSSL": true
}
},
"$schema": "http://json.schemastore.org/launchsettings.json"
}