Permalink
Browse files

Dockerize the app

Had to update gevent because of an ssl error with the previous version
that caused issues when running in Docker.
  • Loading branch information...
Graham42 committed Jan 5, 2017
1 parent 27382c0 commit 3d8e9eb621cc58071bf37f4e3da679693301e9ad
Showing with 58 additions and 1 deletion.
  1. +28 −0 Dockerfile
  2. +17 −0 README.md
  3. +12 −0 docker-compose.yml
  4. +1 −1 requirements.txt
@@ -0,0 +1,28 @@
FROM python:2.7-alpine
RUN apk update && apk upgrade && \
apk add \
gcc python python-dev py2-pip \
# greenlet
musl-dev \
# sys/queue.h
bsd-compat-headers \
# event.h
libevent-dev \
&& rm -rf /var/cache/apk/*
# want all dependencies first so that if it's just a code change, don't have to
# rebuild as much of the container
ADD requirements.txt /opt/requestbin/
RUN pip install -r /opt/requestbin/requirements.txt \
&& rm -rf ~/.pip/cache
# the code
ADD requestbin /opt/requestbin/requestbin/
EXPOSE 8000
WORKDIR /opt/requestbin
CMD gunicorn -b 0.0.0.0:8000 --worker-class gevent --workers 2 --max-requests 1000 requestbin:app
@@ -35,6 +35,23 @@ Now just deploy via git:
It will push to Heroku and give you a URL that your own private RequestBin will be running.
## Deploy your own instance using Docker
On the server/machine you want to host this, you'll first need a machine with
docker and docker-compose installed, then grab the RequestBin source using git:
`$ git clone git://github.com/Runscope/requestbin.git`
Go into the project directory and then build and start the containers
```
$ sudo docker-compose build
$ sudo docker-compose up -d
```
Your own private RequestBin will be running on this server.
Contributors
------------
* Barry Carlyon <barry@barrycarlyon.co.uk>
@@ -0,0 +1,12 @@
app:
build: .
environment:
REALM: prod
REDIS_URL: "//redis:6379"
links:
- redis
ports:
- "8000:8000"
redis:
image: redis
@@ -1,4 +1,4 @@
gevent==0.13.8
gevent==1.0.2
greenlet==0.4.1
ProxyTypes==0.9
nose==1.3.0

0 comments on commit 3d8e9eb

Please sign in to comment.