From b91f10ce7313233da353e8aef44242f47f66f2fb Mon Sep 17 00:00:00 2001 From: Nicolas Favre-Felix Date: Thu, 25 Jul 2019 21:23:29 -0700 Subject: [PATCH] Update Dockerfile to Debian Jessie, enable MessagePack, fix RUN command + add Docker example to README --- Dockerfile | 18 +++++++++--------- README.markdown | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 432f4ef..fd59c52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,14 @@ -FROM tianon/debian:wheezy +FROM debian:jessie MAINTAINER Nicolas Favre-Felix -RUN apt-get -y --force-yes install wget make gcc libevent-dev -RUN apt-get -y --force-yes install redis-server -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.1.tar.gz -RUN cd webdis-0.1.1 && make && make install && cd .. -RUN rm -rf webdis-0.1.1 webdis-0.1.1.tag.gz -RUN apt-get remove -y wget make gcc +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 wget https://github.com/nicolasff/webdis/archive/0.1.7.tar.gz -O webdis-0.1.7.tar.gz +RUN tar -xvzf webdis-0.1.7.tar.gz +RUN cd webdis-0.1.7 && make && make install && cd .. +RUN rm -rf webdis-0.1.7 webdis-0.1.7.tag.gz +RUN apt-get remove -y wget make gcc libevent-dev libmsgpack-dev +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 diff --git a/README.markdown b/README.markdown index 54ad875..d3ddd80 100644 --- a/README.markdown +++ b/README.markdown @@ -19,6 +19,24 @@ curl -d "GET/hello" http://127.0.0.1:7379/ +# Try in Docker +Clone the repository and open a terminal in the webdis directory, then run: +
+$ 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
+
+ + # Features * `GET` and `POST` are supported, as well as `PUT` for file uploads. * JSON output by default, optional JSONP parameter (`?jsonp=myFunction` or `?callback=myFunction`).