try to docker

pull/3/head
Sascha 2023-08-24 11:06:26 +07:00
parent 5bc5064f02
commit 0d54b5ce24
3 changed files with 31 additions and 5 deletions

@ -0,0 +1,15 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Gremlin_BlazorServer/Dockerfile" type="docker-deploy" factoryName="dockerfile" server-name="Docker">
<deployment type="dockerfile">
<settings>
<option name="attachToContainerNeeded" value="true" />
<option name="containerName" value="gremlin_blazorserver" />
<option name="contextFolderPath" value="." />
<option name="publishAllPorts" value="true" />
<option name="sourceFilePath" value="Gremlin_BlazorServer/Dockerfile" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="true" />
<method v="2" />
</configuration>
</component>

@ -1,11 +1,11 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
FROM mcr.microsoft.com/dotnet/nightly/aspnet:8.0-preview AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
EXPOSE 5000
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
FROM mcr.microsoft.com/dotnet/nightly/sdk:8.0-preview AS build
FROM mcr.microsoft.com/dotnet/nightly/runtime:8.0-preview AS run
WORKDIR /src
COPY ["Gremlin_BlazorServer/Gremlin_BlazorServer.csproj", "Gremlin_BlazorServer/"]
RUN dotnet restore "Gremlin_BlazorServer/Gremlin_BlazorServer.csproj"
@ -13,10 +13,14 @@ COPY . .
WORKDIR "/src/Gremlin_BlazorServer"
RUN dotnet build "Gremlin_BlazorServer.csproj" -c Release -o /app/build
FROM run AS run
RUN dotnet dev-certs https
RUN dotnet dev-certs https --trust
FROM build AS publish
RUN dotnet publish "Gremlin_BlazorServer.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Gremlin_BlazorServer.dll"]
ENTRYPOINT ["dotnet", "Gremlin_BlazorServer.dll"]

@ -0,0 +1,7 @@
version: "3.3"
services:
web:
container_name: gremlin_docker
build:
context: ..
dockerfile: /home/sascha/current_coding/Gremlin/Gremlin_BlazorServer/Dockerfile