Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b524743

Browse files
Add Gunicorn configuration.
1 parent 51923fd commit b524743

File tree

4 files changed

+189
-158
lines changed

4 files changed

+189
-158
lines changed

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $(VIRTUAL_ENV):
3333
.PHONY: run
3434
run: env
3535
export LESS_BIN=$(shell which lessc) && \
36-
$(LOCAL_PYTHON) -m gunicorn -w 4 wsgi:app
36+
$(LOCAL_PYTHON) -m gunicorn --config=gunicorn.conf.py
3737

3838
.PHONY: install
3939
install: env

‎gunicorn.conf.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""Gunicorn configuration file."""
2+
from os import environ, path
3+
4+
from dotenv import load_dotenv
5+
6+
basedir = path.abspath(path.dirname(__file__))
7+
load_dotenv(path.join(basedir, ".env"))
8+
9+
ENVIRONMENT = environ.get("ENVIRONMENT")
10+
11+
proc_name = "flasksession"
12+
wsgi_app = "wsgi:app"
13+
bind = "unix:flask.sock"
14+
threads = 4
15+
workers = 2
16+
17+
if ENVIRONMENT == "development":
18+
reload = True
19+
workers = 1
20+
threads = 1
21+
bind = ["127.0.0.1:8000"]
22+
23+
if ENVIRONMENT == "production":
24+
daemon = True
25+
accesslog = "/var/log/flasksession/access.log"
26+
errorlog = "/var/log/flasksession/error.log"
27+
loglevel = "trace"
28+
dogstatsd_tags = "env:prod,service:flasksession,language:python"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /