Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephEShook committed Dec 19, 2024
1 parent 196a86e commit 9c230b9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
ARG TAG_NAME
WORKDIR /app
EXPOSE 8080
Expand All @@ -12,7 +12,7 @@ COPY ./Server/ngnix-proxy-TestCA.cer /etc/ssl/certs
RUN update-ca-certificates


FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src

ENV GCPDeploy=true
Expand All @@ -26,18 +26,18 @@ COPY ["Server/UdapEd.Server.csproj", "Server/"]
COPY ["Client/UdapEd.Client.csproj", "Client/"]
COPY ["Shared/UdapEd.Shared.csproj", "Shared/"]

RUN dotnet restore -p:TargetFramework=net8.0 "Shared/UdapEd.Shared.csproj"
RUN dotnet restore -p:TargetFramework=net8.0 "Server/UdapEd.Server.csproj"
RUN dotnet restore -p:TargetFramework=net8.0 "Client/UdapEd.Client.csproj"
RUN dotnet restore -p:TargetFramework=net9.0 "Shared/UdapEd.Shared.csproj"
RUN dotnet restore -p:TargetFramework=net9.0 "Server/UdapEd.Server.csproj"
RUN dotnet restore -p:TargetFramework=net9.0 "Client/UdapEd.Client.csproj"
COPY . .

RUN dotnet build "Server/UdapEd.Server.csproj" -p:TargetFramework=net8.0 -c Release --no-restore -o /app/build
RUN dotnet build "Server/UdapEd.Server.csproj" -p:TargetFramework=net9.0 -c Release --no-restore -o /app/build


FROM build AS publish
ARG TAG_NAME
ENV UseMauiEssentials=false
RUN dotnet publish "Server/UdapEd.Server.csproj" -p:TargetFramework=net8.0 -c Release --no-restore -o /app/publish /p:UseAppHost=false
RUN dotnet publish "Server/UdapEd.Server.csproj" -p:TargetFramework=net9.0 -c Release --no-restore -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
Expand Down

0 comments on commit 9c230b9

Please sign in to comment.