docker-json-server
docker-json-server copied to clipboard
add routing possibility
the --route option is not there it would be nice if you add it
Probably something you can do without compose as well, but cause I had this at hand and in case this turns out being helpful this is how you get it done using docker-compose
jsonserver:
image: clue/json-server
container_name: jsonserver
volumes:
- ./db.json:/data/db.json
- ./routes.json:/data/routes.json
entrypoint:
- json-server
- db.json
- --routes
- routes.json
- -p 80
ports:
- 4444:80
Note the 4444:80 is just personal setting to have something to take a peek at the json-server (localhost:4444/) This also replies to the ~year old docker-compose support question so linking it. #3
If you override the entrypoint
in your docker-compose.yaml
you can pass the --routes
argument:
volumes:
- ./secrets.json:/data/db.json
- ./routes.json:/data/routes.json
entrypoint: ["bash", "/run.sh", "--routes /data/routes.json"]