A ready-to-use mock REST API server built with JSON Server and Docker, perfect for frontend development, testing, and prototyping.
- 🐳 Docker containerized for easy deployment
- 📁 Sample database with realistic data structures
- 🔄 Auto-reload when data changes
- 🔍 Full CRUD operations with filtering, sorting, pagination
- 🤝 Relationship support (_embed, _expand)
- 📚 Postman collection for easy testing
- Docker installed (Install Docker)
# Clone the repository
git clone https://github.com/anandhuk/json-server-docker.git
cd json-server-docker
# Build and run the container
docker build -t json-server .
docker run -p 3000:3000 -v $(pwd)/db.json:/usr/src/app/db.json json-server
Your API will be available at http://localhost:3000
GET /users?address.city=New York
GET /products?price_gte=50&price_lte=100
GET /products?_page=1&_limit=2
GET /users?_start=1&_end=3
GET /products?_sort=price&_order=desc
GET /users?_sort=name&_order=asc
GET /posts?q=react
GET /posts/1?_embed=comments
GET /orders/1?_expand=user
A complete Postman collection is included in the repository (Postman-collection.json).
All CRUD operations for each resource
Example requests with sample payloads
Environment variables for easy configuration
Test scripts for basic validation
Open Postman
Click "Import" > Select the collection file
Set the base_url
variable to http://localhost:3000
- TODO: Authentication endpoints will be added in future updates
- Local Development
docker run -p 3000:3000 -v $(pwd)/db.json:/usr/src/app/db.json json-server
- Production (with Docker Compose)
docker-compose up -d
- Cloud Deployment
This container can be deployed to any cloud platform that supports Docker:
AWS ECS
Google Cloud Run
Azure Container Instances
Heroku with Docker support
Distributed under the MIT License. See LICENSE
for more information.