Skip to content

Commit 154b952

Browse files
author
Aaron Suarez
authored
Merge pull request #308 from OperationCode/update-uwsgi-settings
Update the uwsgi settings with better production features
2 parents ce03c39 + f384589 commit 154b952

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ COPY pyproject.toml poetry.lock ./
1313
RUN mkdir /static
1414

1515
RUN apt-get update \
16-
&& apt-get install -y libpq-dev gcc \
16+
&& apt-get install -y libpq-dev gcc libpcre3 libpcre3-dev \
1717
&& rm -rf /var/lib/apt/lists/* \
1818
&& pip install --upgrade pip \
1919
&& pip install poetry \

app.ini

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
; app.ini
2+
3+
; NOTE: The configuration in this file came from the following
4+
; sources. These should answer the "why" of the decision for
5+
; each of the configuration options:
6+
; - https://medium.com/bitcraft/docker-composing-a-python-3-flask-app-line-by-line-93b721105777
7+
; - https://www.techatbloomberg.com/blog/configuring-uwsgi-production-deployment/
8+
29
[uwsgi]
10+
strict = true
311
protocol = uwsgi
412
; This is the name of our Python file
513
; minus the file extension
@@ -15,3 +23,11 @@ processes = 2
1523
http = 0.0.0.0:5000
1624
vacuum = true
1725
die-on-term = true
26+
single-interpreter = true
27+
need-app = true
28+
29+
; The logs in production are really hard to sift through because
30+
; the /healthz route is called so often. We don't need to log
31+
; every time the cluster does a healthcheck.
32+
route = ^/healthz donotlog:
33+
route = ^/metrics donotlog:

0 commit comments

Comments
 (0)