Skip to content

馃惓 Add Full Docker Setup (Frontend + Backend + MongoDB with Docker Compose) - #3

Open
parmeet20 wants to merge 2 commits into
ankurdotio:mainfrom
parmeet20:feature/dockerize-app
Open

馃惓 Add Full Docker Setup (Frontend + Backend + MongoDB with Docker Compose)#3
parmeet20 wants to merge 2 commits into
ankurdotio:mainfrom
parmeet20:feature/dockerize-app

Conversation

@parmeet20

Copy link
Copy Markdown

Overview

This PR adds Docker support to the project so the entire stack (frontend, backend, and MongoDB) can be run easily using Docker Compose. The goal is to simplify local setup and make the environment consistent across systems.


What鈥檚 Added

Frontend

  • Dockerfile added for building the Vite React app
  • Production build generates static files

Backend

  • Dockerfile added for Node.js API
  • Uses production dependencies only
  • Configured to connect to MongoDB using environment variables

MongoDB

  • Added official MongoDB container
  • Persistent storage enabled using Docker volumes

Docker Compose 馃惓

  • Added docker-compose.yml to run all services together
  • Services run inside a shared bridge network
  • Backend connects to MongoDB using service name instead of localhost

Networking

All services communicate through Docker鈥檚 internal network.

  • Backend connects to MongoDB using:
    mongodb://mongodb:27017

  • Frontend communicates with backend via exposed ports


How to Run

docker-compose up --build

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