Skip to content

Commit 92a2b48

Browse files
committed
wsgi entrypoint and gunicorn server with proper stdout logging
1 parent 759b67e commit 92a2b48

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ RUN pip install -r requirements.txt
99
COPY . /app
1010

1111
EXPOSE 5000
12-
CMD ["python", "webhooks.py"]
12+
CMD ["gunicorn", "--bind=0.0.0.0:5000", "--workers=3", "wsgi"]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Flask==0.12.2
22
ipaddress==1.0.18
33
requests==2.18.2
4+
gunicorn==19.9.0

webhooks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# under the License.
1717

1818
import logging
19-
from sys import stderr, hexversion
20-
logging.basicConfig(stream=stderr)
19+
from sys import stdout, hexversion
20+
logging.basicConfig(stream=stdout, level=logging.INFO)
2121

2222
import hmac
2323
from hashlib import sha1

wsgi.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from webhooks import application
2+
3+
if __name__ == "__main__":
4+
application.run(debug=False, host='0.0.0.0')

0 commit comments

Comments
 (0)