Skip to content

Conversation

@satyam-code45
Copy link
Contributor

Description

To ensure a consistent, portable, and reproducible environment for both development and production, this PR adds complete Docker support for the RBAC application. It introduces a production-optimized Dockerfile, a Docker Compose configuration for local development, and proper documentation for setup and usage.

The Docker setup allows anyone to easily build, run, and test the application within isolated containers, ensuring identical behavior across environments.


Acceptance Criteria

  • Create a Dockerfile in the project root using an official Node.js image (e.g., node:18-alpine).
  • Optimize the Dockerfile for build caching (copy package.json and install dependencies before copying source code).
  • Create a .dockerignore file to exclude node_modules, .env, logs, and other unnecessary files.
  • Configure the image to start the application using a non-root user for enhanced security.
  • (Optional Bonus) Add a docker-compose.yml file to spin up the Node.js app with a MongoDB service for local development.

Summary of Changes:

  • Added full Docker containerization for the RBAC application.

  • Introduced multi-stage build with security best practices.

  • Added Docker Compose support for MongoDB integration.

  • Added health check endpoint (/api/auth/health).

  • Provided .env.example, README.Docker.md, and DOCKER_QUICK_REFERENCE.md for better developer experience.

  • Patch (bug fix, no new features)

  • Minor (new features, no breaking changes)

  • Major (breaking changes)


Issues

Closes #24 – feat: Dockerize the application for containerized deployment


Checklist

  • I have read the Contributing Guidelines.
  • Created a production-ready multi-stage Dockerfile using node:18-alpine.
  • Optimized Docker build for caching and reproducibility.
  • Implemented non-root user for container security.
  • Added .dockerignore to clean up build context.
  • Configured docker-compose.yml with MongoDB service.
  • Added README.Docker.md and DOCKER_QUICK_REFERENCE.md documentation.
  • Verified Docker build and Compose stack functionality.
  • Tested /api/auth/health endpoint successfully.
  • Ensured all environment variables are isolated and secured.

Labels: feature, devops, docker

Code of Conduct:
☑️ I agree to follow this project's Code of Conduct.

@Somilg11 Somilg11 merged commit 312ebce into OPCODE-Open-Spring-Fest:main Oct 30, 2025
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants