Giter VIP home page Giter VIP logo

docker-json-server's Introduction

Hi there 👋

What have I been up to recently?

I've been working on some 100+ projects that total at over 100 Mio downloads. Here's an excerpt of some of my recent projects:

Sponsor my work

If you use any of my packages, please consider sponsoring me! Do you sponsor me on GitHub? Thank you for supporting sustainable open-source, you're awesome! ❤️ Enjoy exclusive early access to my projects! 🎉

clue·access

Let's get in touch

Working with open source is both my passion and what I do professionally.

  • Do you use any of my packages? Awesome! Say hello and send a message to @another_clue on Twitter.

  • Looking for community support? Open a discussion in the respective repository, I'm happy to help!

  • Schedule an appointment if you're looking for professional support.

Rock on 🤘

docker-json-server's People

Contributors

clue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-json-server's Issues

Building and running docker image on local machine is not working.

I tried to clone your repository and tried to build docker image.

When I tried to run newly built docker image, Server which is running inside docker container was not accessible from outside.
After more debug i found issue

run.sh needs to be modified with adding host -H 0.0.0.0

Getting error of "Error: Data must be an object." when running through docker, but not if I just start json-server normally through cli

Hello,
For some reason I keep getting the error of "Error: Data must be an object." when running through docker, but not if I just start json-server normally through cli.

This is the run.sh I was trying to use

#!/bin/bash

args="$@"

args="$@"
host="-H 0.0.0.0"
port="-p 9004"
dest="http://mysite.com/news/index.json"

json-server $args $port $host $dest

If I just run it like this, it works just fine. :

json-server -p 9004 -H 0.0.0.0 http://mysite.com/news/index.json

Thanks,
-MH

Opening to other than localhost

I had an issue when using the default configuration threw a Docker Swarm.
I couldn't access the services becaus json-server was listening only to localhost.

Could you bring -H 0.0.0.0 on the run.sh by default so others won't have the same problem ?

args="$@ -H 0.0.0.0 -p 80"

Empty Response

Empty response being returned from the docker container.

image
I don't know if this is a problem with the json server in general? I've tried writing my own Dockerfiles before I found this project (just to see if I could get something to work).

Any advise would be appreciated!

--watch is not reloading when host file changes

I passed the --watch argument.

when db.json file changes in host machine the changes also obviously reflects inside docker container /data/db.json since volume mounted. But it still supplies the old db.json values.

The file is changed Right ?

When Post through curl it works properly. Restarting docker container it works properly.

Changing file directly not working (--watch)

Add support for docker-compose

Should be as simple as a file like the following into a file called docker-compose.yml:

json_server:
  build: .
  command: 'sh run.sh'
  working_dir: /data
  ports:
   - '80:80'

Then, perhaps you could later map the volume in via docker-compose instead of via the Dockerfile:

json_server:
  build: .
  command: 'sh run.sh'
  working_dir: /data
  ports:
   - '80:80'
  volumes:
   - ./data:/data

suggestion for readme.md

Hi, just a suggestion for the readme.md.
In my setup, the host file db.json was not updated after I added data using the REST API. This was resolved when I mapped the folder containing db.json as volume instead of the file directly. Might be added to the readme.

http://localhost:80/posts with example json crashes container

Hi.
I run the container with the example json (posts and comments). When I go to the adress: http://localhost:80/posts I get the data but the container crashes. The same if I use curl.

I get the response:

GET /posts 304 16.824 ms - -

/usr/local/lib/node_modules/json-server/node_modules/lowdb/src/disk.js:23
if (err) throw err
^
Error: EBUSY, rename '/data/.~db.json'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.