Files
GreenHomeBack/Dockerfile

21 lines
594 B
Docker

FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Install Node.js and build tools for native modules
RUN apt-get update && apt-get install -y nodejs npm python3 make g++ && rm -rf /var/lib/apt/lists/*
COPY ./src/ .
# Install frontend dependencies before dotnet build
RUN npm install --prefix ./GreenHome.Web
RUN dotnet restore --verbosity detailed
RUN dotnet publish -c Release -o /app
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app
COPY --from=build /app .
RUN mkdir -p /app/My_StaticFiles
RUN mkdir -p /app/files
ENTRYPOINT ["dotnet", "GreenHome.Api.dll"]