1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-28 09:08:50 +02: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

View File

@ -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
View 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
View 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
View File

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

View File

@ -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