Skip to content

[feat]: Add Docker and Docker Compose configuration for local development and production workflows #209

@khushigoel44-afk

Description

@khushigoel44-afk

Before submitting

  • I have searched existing issues and discussions to make sure this idea is not already covered.
  • I have read the contribution guidelines.

Problem statement

Currently, setting up CodeLens requires manual installation of specific Node.js runtimes, individual environment variable configurations, and a locally running MongoDB instance across different contributor machines.

This introduces friction for GSSoC contributors, leads to configuration mismatches ("it works on my machine" syndrome), and makes onboarding inefficient. There is no unified, reproducible runtime environment for the MERN stack application.

Proposed solution

Containerize the application to standardize both the development and production environments. This will be achieved by introducing:

  • Backend Dockerfile: A multi-stage build setup inside server/ to install dependencies and run the Express app.
  • Frontend Dockerfile: A multi-stage build inside frontend/ optimizing the Vite + Tailwind CSS build process.
  • Docker Compose: A root-level docker-compose.yml file to orchestrate the frontend container, backend container, and an official MongoDB image container with persistent volume data storage.

Alternative solutions considered

  • Manual Setup Guides: Updating the documentation with extensive step-by-step installation guides for every OS (Windows, Mac, Linux). This was rejected because documentation frequently goes out of date, whereas configuration files enforce environment consistency programmatically.
  • Using an External Cloud Database Only: Forcing users to use MongoDB Atlas for local development. This was rejected because local development shouldn't strictly depend on external network connectivity or shared database credentials.

Use case or motivation

This feature minimizes configuration overhead for new and existing developers. Anyone tracking the project for GSSoC 2026 can clone the repository and spin up the complete frontend, backend, and database stack using a single command:

docker compose up --build. 

It also lays the crucial architectural groundwork required to easily deploy the platform to cloud hosting providers later.

References or mockups

No visual mockups are required as this is an infrastructure-level improvement.

Additional context

  • Dependencies: Requires Docker Desktop or Docker Engine installed on the host machine.
  • Risks: We must ensure that local file changes in the frontend/backend directory are properly mapped via Docker bind mounts so that Vite's Hot Module Replacement (HMR) and Node's development reloads still work seamlessly without requiring a container rebuild after every file save.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions