From 9582a689032599eb9c44894da3641fc89801547d Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Sun, 22 Feb 2015 08:42:20 +0000 Subject: [PATCH 1/2] Add basic Dockerfile. --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..03010da --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM ubuntu:trusty + +ADD . /httpbin + +RUN apt-get update -y && apt-get -y install python-pip && pip install gunicorn && pip install /httpbin + +EXPOSE 8080 + +CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8080", "httpbin:app"] From bf63216aa1224069e1f1a0ab837ccd5d46b50f86 Mon Sep 17 00:00:00 2001 From: Cory Benfield Date: Sun, 22 Feb 2015 09:38:00 +0000 Subject: [PATCH 2/2] Set GUNICORN_WORKERS by environment variable. --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 03010da..36198f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,11 @@ FROM ubuntu:trusty +ENV GUNICORN_WORKERS=4 + ADD . /httpbin RUN apt-get update -y && apt-get -y install python-pip && pip install gunicorn && pip install /httpbin EXPOSE 8080 -CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8080", "httpbin:app"] +CMD gunicorn -w "$GUNICORN_WORKERS" -b 0.0.0.0:8080 httpbin:app