40 lines
1.1 KiB
Docker
40 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1
|
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
WORKDIR /source
|
|
|
|
COPY src/Aquarium.Shared/Aquarium.Shared.csproj src/Aquarium.Shared/
|
|
COPY src/Aquarium.Client/Aquarium.Client.csproj src/Aquarium.Client/
|
|
COPY src/Aquarium.Server/Aquarium.Server.csproj src/Aquarium.Server/
|
|
|
|
RUN dotnet restore src/Aquarium.Client/Aquarium.Client.csproj
|
|
RUN dotnet restore src/Aquarium.Server/Aquarium.Server.csproj
|
|
|
|
COPY src/Aquarium.Shared/ src/Aquarium.Shared/
|
|
COPY src/Aquarium.Client/ src/Aquarium.Client/
|
|
COPY src/Aquarium.Server/ src/Aquarium.Server/
|
|
|
|
RUN dotnet publish src/Aquarium.Client/Aquarium.Client.csproj \
|
|
--configuration Release \
|
|
--output /artifacts/client \
|
|
--no-restore
|
|
|
|
RUN dotnet publish src/Aquarium.Server/Aquarium.Server.csproj \
|
|
--configuration Release \
|
|
--output /artifacts/server \
|
|
--no-restore
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
|
|
WORKDIR /app
|
|
|
|
ENV ASPNETCORE_URLS=http://+:8080 \
|
|
DOTNET_EnableDiagnostics=0
|
|
|
|
EXPOSE 8080
|
|
|
|
COPY --from=build /artifacts/server/ ./
|
|
COPY --from=build /artifacts/client/wwwroot/ ./wwwroot/
|
|
|
|
USER app
|
|
ENTRYPOINT ["dotnet", "Aquarium.Server.dll"]
|