Open RashiqAzhan opened 2 years ago
Please add the --host
option to make it accessible from inside a docker container. I tried this in a docker-compose yaml and it worked. Got this from 1009
json-server --watch ./db.json --port 3204 --host 0.0.0.0
I can get the
json-server
working on my local machine but not from docker. I don't know what gives.docker-compose.yaml:
Dockerfile:
package.json:
Sample from db.json:
The data in the
db.json
appears on the browser when the server is running on the local machine but not when it is running on the container with an exposed port. The default3000
port is mapped to3201
.Any help is greatly appreciated.