Docker Compose orchestrates the entire DailyNews stack — React/Vite frontend, Node.js/Express backend, and MongoDB — as three coordinated services that start, stop, and communicate with a single command. Each service runs in its own isolated container, with live volume mounts for hot-reloading during development and a named volume to persist your database across restarts.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/miikorz/DailyNews/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before running DailyNews with Docker Compose, make sure you have the following installed on your machine:- Docker Engine — Install Docker
- Docker Compose — Included with Docker Desktop; for Linux servers, follow the standalone install guide
Services Overview
frontend
React/Vite application served by
serve. Exposed on port 3000 and depends on the backend service. The ./frontend directory is mounted for live development.backend
Node.js/Express REST API compiled from TypeScript. Exposed on port 3001, depends on
mongo, and reads environment variables from the root .env file.mongo
Official MongoDB image. Exposed on port 27017 with a named volume
mongo_data that persists your database between container restarts.docker-compose.yml
The full Compose configuration that wires the three services together:Backend Dockerfile
Located atbackend/Dockerfile. Installs dependencies, compiles the TypeScript source with npm run build, and starts the compiled server via npm start (node dist/server.js):
Frontend Dockerfile
Located atfrontend/Dockerfile. Installs dependencies, installs the serve static file server globally, builds the Vite production bundle, and serves the dist directory:
Common Commands
npm Scripts
Thebackend/package.json includes four convenience scripts that wrap the raw docker-compose commands. Run these from the backend/ directory:
| Script | Command | Description |
|---|---|---|
npm run docker:build | docker-compose build | Build (or rebuild) all service images without starting containers. |
npm run docker:up | docker-compose up --watch | Start all services in watch mode — Compose re-syncs files on change. |
npm run docker:down | docker-compose down | Stop and remove all containers; the mongo_data volume is preserved. |
npm run docker:restart | docker-compose down && docker-compose up --build | Tear down then rebuild and restart everything from scratch. |
Volume Mounts
DailyNews uses volume mounts to keep your local source files in sync with the running containers:./frontend:/frontend— Your localfrontend/directory is mounted into the frontend container at/frontend. Any changes to source files are reflected inside the container without a rebuild../backend:/backend— Your localbackend/directory is mounted into the backend container at/backend, enabling live restarts when using a file watcher such asnodemon.mongo_data:/data/db— A Docker-managed named volume that stores MongoDB data files. This volume survivesdocker-compose downso your database is never lost between restarts. To wipe the database entirely, rundocker-compose down -v.
Accessing the Services
Once the stack is running, the three services are reachable at:| Service | URL |
|---|---|
| Frontend | http://localhost:3000 |
| Backend API | http://localhost:3001 |
| MongoDB | mongodb://localhost:27017/feed-db |
/feed — for example, GET http://localhost:3001/feed returns all aggregated news items.