From 51932ff90340a9363868972c6eba2846458bfa53 Mon Sep 17 00:00:00 2001 From: vkim Date: Tue, 15 Sep 2015 17:45:28 +1000 Subject: [PATCH] Update README.md Docker does not allow to "move" file as part of the rename procedure. For what ever reasons json-server needs to do it. It throws exception: /usr/local/lib/node_modules/json-server/node_modules/lowdb/src/disk.js:14 if (err) throw err ^ Error: EBUSY: resource busy or locked, rename '/data/.~db.json' -> '/data/db.json' at Error (native) However when docker mounts directory from host to the container then any files within directory can be "moved". --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 684bd68..b40d030 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,12 @@ Further runs will be immediate, as the image will be cached locally. The recommended way to run this container looks like this: ```bash -$ docker run -d -p 80:80 -v /home/user/articles.json:/data/db.json clue/json-server +$ docker run -d -p 80:80 -v /home/user/data/:/data/ clue/json-server ``` +where /home/user/data directory contains db.json file. + + The above example exposes the JSON Server REST API on port 80, so that you can now browse to: ```