Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ RUN apt update -y && apt install python3-pip git -y && pip3 install --no-cache-d

ADD Pipfile Pipfile.lock /httpbin/
WORKDIR /httpbin
RUN /bin/bash -c "pip3 install --no-cache-dir -r <(pipenv lock -r)"
RUN /bin/bash -c "pip3 install --no-cache-dir -r <(pipenv requirements)"

ADD . /httpbin
RUN pip3 install --no-cache-dir /httpbin
RUN chmod +x /httpbin/httpbin.bash

EXPOSE 80

CMD ["gunicorn", "-b", "0.0.0.0:80", "httpbin:app", "-k", "gevent"]
CMD ["/httpbin/httpbin.bash"]
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ docker pull kennethreitz/httpbin
docker run -p 80:80 kennethreitz/httpbin
```

Some enviroments do not allow to bind to a privileged port. To run it on a
different port instead of port 80, set the environment variables as follows:

```sh
docker run -e HTTPIN_PORT=8000 -p 8000:8000 kennethreitz/httpbin
```

See http://httpbin.org for more information.

## Officially Deployed at:
Expand Down
5 changes: 5 additions & 0 deletions httpbin.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
exec gunicorn \
-b ${HTTPBIN_HOST:-0.0.0.0}:${HTTPBIN_PORT:-80} \
-k gevent \
httpbin:app