Urban Store ships with aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ALEJ4NDRO2025/urban-store/llms.txt
Use this file to discover all available pages before exploring further.
docker-compose.yml at the repository root that orchestrates the entire stack in a single command. Three services are defined — the Django REST API backend, the Next.js storefront frontend, and a local MongoDB 7 instance — along with one named volume that persists your database across restarts.
Services Overview
| Service | Port | Description |
|---|---|---|
backend | 8000 | Django REST API (Python 3.13, python manage.py runserver) |
frontend | 3000 | Next.js storefront (Node 20, npm run dev) |
mongo | 27017 | MongoDB 7 — local development only |
docker-compose.yml
Building and Starting
Build images and start all services
The first time you run the stack, or after any change to aDockerfile or requirements.txt, build the images before starting:
Start without rebuilding
For subsequent runs where the images are already built:Stop all services
mongo_data volume. To also delete the volume (and all local MongoDB data), add the -v flag:
Viewing Logs
Stream live logs from a specific service:Volume Mounts and Live Reload
Both application services mount their local source directories into the container so that code changes are reflected immediately without a rebuild:- Backend —
./backendis mounted to/appinside the container. Django’s development server (runserver) reloads automatically when Python files change. - Frontend —
./frontendis mounted to/appinside the container. Next.js development mode (npm run dev) supports hot module replacement out of the box. mongo_data— a named Docker volume mounted at/data/dbinside themongocontainer. MongoDB data persists acrossdocker-compose downanddocker-compose upcycles.
Dockerfiles
Backend (backend/Dockerfile)
Frontend (frontend/Dockerfile)
Production Considerations
In production you would typically use MongoDB Atlas instead of the local
mongo service. Update MONGODB_URI in backend/.env to your Atlas connection string and remove (or comment out) the mongo service and mongo_data volume from docker-compose.yml. The backend already uses mongoengine.connect() with TLS via certifi, so Atlas connections work without any code changes.- Set
DEBUG = Falseinconfig/settings.pyto disable the Django debug page and prevent internal error details from being exposed. - Add your production domain to
ALLOWED_HOSTSinconfig/settings.py, for exampleALLOWED_HOSTS = ["yourdomain.com"]. - Place a reverse proxy such as nginx in front of both services. nginx handles TLS termination, static file serving, and forwards requests to the backend on port
8000and the frontend on port3000. - Replace the
CMDin both Dockerfiles with production-grade servers: Gunicorn for the Django backend andnext start(afternext build) for the Next.js frontend.