QrRapido/Dockerfile
Ricardo Carneiro b54aa295ac
All checks were successful
Deploy QR Rapido / test (push) Successful in 44s
Deploy QR Rapido / build-and-push (push) Successful in 12m59s
Deploy QR Rapido / deploy-staging (push) Has been skipped
Deploy QR Rapido / deploy-production (push) Successful in 1m24s
fix: add Node.js to Docker build stage for frontend compilation
- Install Node.js 18.x in Docker build stage
- Add MongoDB DataProtection for Swarm compatibility
- Enables shared authentication keys across multiple replicas

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-22 16:25:54 -03:00

43 lines
1.1 KiB
Docker
Raw Permalink Blame History

# Build stage
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
# Install Node.js for frontend build
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore --runtime linux-arm64
# Copy everything else and build
COPY . .
RUN dotnet build "QRRapidoApp.csproj" -c Release --runtime linux-arm64 --no-restore
# Publish stage
FROM build AS publish
RUN dotnet publish "QRRapidoApp.csproj" -c Release -o /app/publish \
--runtime linux-arm64 \
--no-restore \
--no-build \
--self-contained false
# Final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
WORKDIR /app
# Install libgdiplus for System.Drawing (se necess<73>rio para QR codes)
RUN apt-get update && apt-get install -y libgdiplus && rm -rf /var/lib/apt/lists/*
# Copy published app
COPY --from=publish /app/publish .
# Expose port
EXPOSE 8080
# Create non-root user
RUN adduser --disabled-password --gecos '' appuser && chown -R appuser /app
USER appuser
# Set entry point
ENTRYPOINT ["dotnet", "QRRapidoApp.dll"]