# syntax=docker/dockerfile:1.7 # ---- Backend build ---- FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build WORKDIR /src COPY backend/backend.csproj backend/ RUN dotnet restore backend/backend.csproj COPY backend/ backend/ RUN dotnet publish backend/backend.csproj -c Release -o /publish # ---- Client bundle ---- FROM alpine:3.20 AS bundle WORKDIR /src RUN apk add --no-cache tar gzip COPY client/ client/ COPY requirements.txt requirements-nodeps.txt ./ RUN tar czf /client.tar.gz client/ requirements.txt requirements-nodeps.txt # ---- Final ---- FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /app COPY --from=build /publish/ ./ RUN mkdir -p ./wwwroot && mkdir -p /data /keys COPY --from=bundle /client.tar.gz ./wwwroot/client.tar.gz ENV ASPNETCORE_URLS=http://+:8080 ENV ConnectionStrings__Default="Data Source=/data/assistant.db" ENV Install__ClientTarballPath="/app/wwwroot/client.tar.gz" EXPOSE 8080 ENTRYPOINT ["dotnet", "backend.dll"]