aa82ee542c
Bootstrap CSS/JS and jQuery were gitignored (wwwroot/lib/) so they were missing from Docker builds, causing all dropdown menus and styling to break on the deployed version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
41 lines
934 B
Docker
41 lines
934 B
Docker
# Build stage
|
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
WORKDIR /src
|
|
|
|
# Copy csproj and restore dependencies
|
|
COPY MoneyMap.csproj .
|
|
RUN dotnet restore
|
|
|
|
# Install libman CLI for client-side library restore
|
|
RUN dotnet tool install -g Microsoft.Web.LibraryManager.Cli
|
|
ENV PATH="${PATH}:/root/.dotnet/tools"
|
|
|
|
# Copy everything else and build
|
|
COPY . .
|
|
RUN libman restore
|
|
RUN dotnet publish -c Release -o /app/publish
|
|
|
|
# Runtime stage
|
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
|
|
WORKDIR /app
|
|
|
|
# Install ImageMagick dependencies for Magick.NET
|
|
RUN apt-get update && apt-get install -y \
|
|
libmagickwand-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy published app
|
|
COPY --from=build /app/publish .
|
|
|
|
# Create directory for receipts
|
|
RUN mkdir -p /app/receipts
|
|
|
|
# Expose port
|
|
EXPOSE 5010
|
|
|
|
# Set environment variables
|
|
ENV ASPNETCORE_URLS=http://+:5010
|
|
ENV ASPNETCORE_ENVIRONMENT=Production
|
|
|
|
ENTRYPOINT ["dotnet", "MoneyMap.dll"]
|