Skip to content

Add Docker support for web application#1

Merged
Giannoudis merged 3 commits intoPayroll-Engine:mainfrom
gsayer:feature/docker-stack
Jul 17, 2025
Merged

Add Docker support for web application#1
Giannoudis merged 3 commits intoPayroll-Engine:mainfrom
gsayer:feature/docker-stack

Conversation

@gsayer
Copy link
Copy Markdown
Contributor

@gsayer gsayer commented Jul 9, 2025

Overview

This PR adds Docker containerization support for the PayrollEngine Web Application (Blazor), enabling easy deployment through Docker containers.

What's Changed

  • ✅ Added Dockerfile for .NET 9.0 Blazor web application
  • ✅ Updated all projects to .NET 9.0 for container compatibility
  • ✅ Updated Directory.Build.props to suppress blocking warnings
  • ✅ Configured application for containerized environment

Code Changes Explanation

These minimal code changes were necessary for Docker compatibility:

1. .NET 9.0 Migration

  • Files modified: All .csproj files (Server, Core, Presentation, ViewModel, Shared), Directory.Build.props
  • Why: .NET 9.0 provides better container support and improved Blazor performance
  • Impact: Maintains full backward compatibility while enabling modern container features

2. Build Configuration

  • File modified: Directory.Build.props
  • Change: Added <WarningsAsErrors /> and <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
  • Why: Nullable reference type warnings were blocking Docker builds
  • Impact: Allows compilation while maintaining code quality standards

3. Application Configuration

  • Files modified: Server/appsettings.json, Server/appsettings.Development.json
  • Change: Added environment variables support for backend connection
  • Why: Enables dynamic configuration in containerized environments
  • Impact: Allows flexible deployment without hardcoded URLs

Why These Changes

  • Enables containerized deployment for the web interface
  • Provides consistent environment across development and production
  • Simplifies deployment process for end users
  • Maintains existing functionality while adding Docker support

How to Test

  1. Build the Docker image:

    docker build -t payroll-webapp .
  2. Run with backend connection:

    docker run -p 8081:5001 \
      -e BackendAddress="http://localhost:5000" \
      payroll-webapp
  3. Verify web app is accessible at http://localhost:8081

Breaking Changes

None - existing deployment methods remain unchanged.

Related Issues

Part of #2 - Request for Docker Compose Stack implementation

gsayer added 3 commits July 8, 2025 20:57
…re builds

- Add BUILDPLATFORM and TARGETARCH support to Dockerfile
- Use architecture-specific restore and publish commands
- Remove problematic --no-restore flag to prevent NuGet resolution errors
- Supports both ARM64 and x86_64 builds
- Resolves build issues reported in PayrollEngine/PayrollEngine#2
@Giannoudis Giannoudis merged commit 8a36d74 into Payroll-Engine:main Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants