Skip to content

Commit a9898da

Browse files
committed
Add a Dockerfile
1 parent 663cb2e commit a9898da

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM fedora:latest
2+
MAINTAINER "Laurent Rineau" <[email protected]>
3+
4+
RUN yum -y update
5+
RUN yum -y install python-pip && yum clean all
6+
7+
ADD LICENSE requirements.txt webhooks.py config.json hooks /src/
8+
9+
RUN cd /src; pip install -r requirements.txt
10+
11+
EXPOSE 5000
12+
13+
WORKDIR /src
14+
CMD ["python", "/src/webhooks.py"]

README.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ executable and has a shebang. A simple example in Python could be:
9494
f.write(json.dumps(payload))
9595

9696

97-
Deploy
98-
======
97+
Deploy in Apache
98+
==================
9999

100100
To deploy in Apache, just add a ``WSGIScriptAlias`` directive to your
101101
VirtualHost file:
@@ -126,6 +126,18 @@ And add a Webhook to the WSGI script URL:
126126

127127
http://my.site.com/webhooks
128128

129+
Deploy in a Docker container
130+
============================
131+
132+
To deploy in a docker container, you have to expose the port 5000, for
133+
example with the following command:
134+
::
135+
docker run -d --name webhooks -p 5000:5000 lrineau/python-github-webhooks
136+
137+
You can also mount volume to setup the ``hooks/`` directory, and the file
138+
``config.json``:
139+
::
140+
docker run -d --name webhooks -v /path/to/my/hooks:/src/hooks -v /path/to/my/config.json:/src/config.json -p 5000:5000 lrineau/python-github-webhooks
129141

130142
Debug
131143
=====

0 commit comments

Comments
 (0)