Files
SmartReports/CertReports.Syncfusion/Dockerfile

37 lines
1.2 KiB
Docker

# ── Build stage ──────────────────────────────────────────────────────
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY *.csproj .
RUN dotnet restore
COPY . .
RUN dotnet publish -c Release -o /app/publish --no-restore
# ── Runtime stage ────────────────────────────────────────────────────
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
# Installa font per il rendering PDF (Syncfusion ne ha bisogno)
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libfontconfig1 \
fonts-dejavu-core && \
rm -rf /var/lib/apt/lists/*
# Crea directory per i log
RUN mkdir -p /app/Logs
COPY --from=build /app/publish .
# Non-root user per sicurezza
RUN groupadd -r appuser && useradd -r -g appuser appuser && \
chown -R appuser:appuser /app
USER appuser
EXPOSE 8080
ENV ASPNETCORE_URLS=http://+:8080
ENV ASPNETCORE_ENVIRONMENT=Production
ENTRYPOINT ["dotnet", "CertReports.Syncfusion.dll"]