Skip to content

Conversation

@Isrealade
Copy link

This PR introduces a Dockerized setup for the Frontend along with a GitHub Actions workflow (.github/workflows/frontend.yaml) to streamline builds, testing, and deployment.

It also prepares the project for SonarCloud quality checks and DockerHub publishing, so the team can adopt a full CI/CD workflow with code quality gates and automated container image pushes.


🔨 Changes Introduced

  • Dockerfile for the Frontend

    • Multi-stage build for both development and production.
    • Dev mode supports live reload (npm run dev).
    • Production mode serves optimized build.
  • .dockerignore created to reduce image size (ignores node_modules, .next, logs, etc.).

  • docker-compose.yaml for local development using the dev stage.

  • GitHub Actions Workflow

    • Builds the Docker image on push/PR.
    • Configurable stages for dev and prod.
    • Includes commented-out steps for SonarCloud scan and DockerHub push.

⚙️ Required GitHub Secrets & Variables

To enable the SonarCloud scan and DockerHub push, the following must be configured in the repository settings:

  • SonarCloud

    • secrets.SONAR_TOKEN → Personal access token generated from SonarCloud.
    • Further quality gate rules and analysis settings can be configured directly in the SonarCloud web UI after the project is connected.
  • DockerHub

    • vars.DOCKERHUB_USERNAME → Your DockerHub username.
    • secrets.DOCKERHUB_TOKEN → DockerHub access token (recommended) or account password.

📖 References


🚀 Next Steps

  • Uncomment the Sonar scan job in the workflow once SONAR_TOKEN is set.
  • Uncomment the DockerHub push step once DockerHub credentials are added.

✅ Benefits

  • Developers can now run the app locally in Docker (docker-compose up).
  • CI/CD pipeline ensures reproducible builds.
  • SonarCloud integration enforces code quality.
  • DockerHub integration enables image distribution and easier deployment.

This lays the foundation for automated CI/CD and code quality checks, while keeping the setup flexible for the team’s deployment needs.

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.

1 participant