Update Dockerfile to Debian Jessie, enable MessagePack, fix RUN command + add Docker example to README

master
Nicolas Favre-Felix 5 years ago
parent 60f9be88da
commit b91f10ce73

@ -1,14 +1,14 @@
FROM tianon/debian:wheezy FROM debian:jessie
MAINTAINER Nicolas Favre-Felix <n.favrefelix@gmail.com> MAINTAINER Nicolas Favre-Felix <n.favrefelix@gmail.com>
RUN apt-get -y --force-yes install wget make gcc libevent-dev RUN apt-get -y update && apt-get -y upgrade && apt-get -y --force-yes install wget make gcc libevent-dev libmsgpack-dev redis-server
RUN apt-get -y --force-yes install redis-server RUN wget https://github.com/nicolasff/webdis/archive/0.1.7.tar.gz -O webdis-0.1.7.tar.gz
RUN wget --no-check-certificate https://github.com/nicolasff/webdis/archive/0.1.1.tar.gz -O webdis-0.1.1.tar.gz RUN tar -xvzf webdis-0.1.7.tar.gz
RUN tar -xvzf webdis-0.1.1.tar.gz RUN cd webdis-0.1.7 && make && make install && cd ..
RUN cd webdis-0.1.1 && make && make install && cd .. RUN rm -rf webdis-0.1.7 webdis-0.1.7.tag.gz
RUN rm -rf webdis-0.1.1 webdis-0.1.1.tag.gz RUN apt-get remove -y wget make gcc libevent-dev libmsgpack-dev
RUN apt-get remove -y wget make gcc RUN sed -i -e 's/"daemonize":.*true,/"daemonize": false,/g' /etc/webdis.prod.json
CMD /etc/init.d/redis-server start && /usr/local/bin/webdis /etc/webdis.prod.json && bash CMD /etc/init.d/redis-server start && /usr/local/bin/webdis /etc/webdis.prod.json
EXPOSE 7379 EXPOSE 7379

@ -19,6 +19,24 @@ curl -d "GET/hello" http://127.0.0.1:7379/
</pre> </pre>
# Try in Docker
Clone the repository and open a terminal in the webdis directory, then run:
<pre>
$ docker build -t webdis .
[...]
$ docker run --rm -d -p 7379:7379 webdis
f0a2763fd456ac1f7ebff80eeafd6a5cd0fc7f06c69d0f7717fb2bdcec65926e
$ curl http://127.0.0.1:7379/PING
{"PING":[true,"PONG"]}
# To stop it:
$ docker kill $(docker ps | grep webdis | cut -c 1-12)
f0a2763fd456
</pre>
# Features # Features
* `GET` and `POST` are supported, as well as `PUT` for file uploads. * `GET` and `POST` are supported, as well as `PUT` for file uploads.
* JSON output by default, optional JSONP parameter (`?jsonp=myFunction` or `?callback=myFunction`). * JSON output by default, optional JSONP parameter (`?jsonp=myFunction` or `?callback=myFunction`).

Loading…
Cancel
Save