1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-16 11:58:47 +00:00

add json-server

This commit is contained in:
kev 2016-05-09 10:28:37 +08:00
parent 1b598ed8ec
commit 95b0cb5345
5 changed files with 44 additions and 0 deletions

@ -58,6 +58,7 @@ A collection of delicious docker recipes.
- [x] jamapi
- [x] jenkins-arm :beetle:
- [x] joomla
- [x] json-server
- [x] mantisbt
- [x] mariadb
- [x] minidlna

18
json-server/Dockerfile Normal file

@ -0,0 +1,18 @@
#
# Dockerfile for json-server
#
FROM alpine
MAINTAINER kev <noreply@easypi.info>
WORKDIR /app
RUN set -xe \
&& apk add -U nodejs \
&& npm install -g json-server \
&& rm -rf /tmp/npm* /var/cache/apk/*
EXPOSE 3000
ENTRYPOINT ["json-server"]
CMD ["--help"]

8
json-server/README.md Normal file

@ -0,0 +1,8 @@
json-server
===========
![](https://badge.imagelayers.io/vimagick/json-server:latest.svg)
Get a full fake REST API with zero coding in less than 30 seconds (seriously) with [json-server][1].
[1]: https://github.com/typicode/json-server

9
json-server/db.json Normal file

@ -0,0 +1,9 @@
{
"posts": [
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 }
],
"profile": { "name": "typicode" }
}

@ -0,0 +1,8 @@
json-server:
image: vimagick/json-server
command: -w db.json
ports:
- "3000:3000"
volumes:
- ./db.json:/app/db.json
restart: always