File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM fedora:latest
2+ MAINTAINER "Laurent Rineau" <laurent.rineau@cgal.org>
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" ]
Original file line number Diff line number Diff 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
100100To deploy in Apache, just add a ``WSGIScriptAlias `` directive to your
101101VirtualHost 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
130142Debug
131143=====
You can’t perform that action at this time.
0 commit comments