Skip to content

Commit 2add353

Browse files
authored
Merge pull request #223 from networktocode/nn_dev3
Adding Custom UWSGI Testing
2 parents a75157c + 00e1209 commit 2add353

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

tasks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,10 @@ def compose_nautobot(context):
403403
context.run("docker pull networktocode/nautobot-lab:latest ", pty=True)
404404

405405
# Start the container
406-
context.run("docker run -itd --rm --name nautobot -p 8000:8000 networktocode/nautobot-lab:latest", pty=True)
406+
context.run(
407+
"docker run -itd --rm --name nautobot -v $(pwd)/uwsgi.ini:/opt/nautobot/uwsgi.ini -p 8000:8000 networktocode/nautobot-lab:latest",
408+
pty=True,
409+
)
407410

408411
# Execute the load demo data
409412
context.run("sleep 5 && docker exec -it nautobot load-mock-data", pty=True)

uwsgi.ini

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[uwsgi]
2+
; The IP address (typically localhost) and port that the WSGI process should listen on
3+
http = 0.0.0.0:8000
4+
5+
; Fail to start if any parameter in the configuration file isn’t explicitly understood by uWSGI
6+
strict = true
7+
8+
; Enable master process to gracefully re-spawn and pre-fork workers
9+
master = true
10+
11+
; Allow Python app-generated threads to run
12+
enable-threads = true
13+
14+
;Try to remove all of the generated file/sockets during shutdown
15+
vacuum = true
16+
17+
; Do not use multiple interpreters, allowing only Nautobot to run
18+
single-interpreter = true
19+
20+
; Shutdown when receiving SIGTERM (default is respawn)
21+
die-on-term = true
22+
23+
; Prevents uWSGI from starting if it is unable load Nautobot (usually due to errors)
24+
need-app = true
25+
26+
; By default, uWSGI has rather verbose logging that can be noisy
27+
disable-logging = true
28+
29+
; Assert that critical 4xx and 5xx errors are still logged
30+
log-4xx = true
31+
log-5xx = true
32+
33+
;
34+
; Advanced settings (disabled by default)
35+
; Customize these for your environment if and only if you need them.
36+
; Ref: https://uwsgi-docs.readthedocs.io/en/latest/Options.html
37+
;
38+
39+
; Number of uWSGI workers to spawn. This should typically be 2n+1, where n is the number of CPU cores present.
40+
; processes = 5
41+
42+
; If using subdirectory hosting e.g. example.com/nautobot, you must uncomment this line. Otherwise you'll get double paths e.g. example.com/nautobot/nautobot/.
43+
; See: https://uwsgi-docs.readthedocs.io/en/latest/Changelog-2.0.11.html#fixpathinfo-routing-action
44+
; route-run = fixpathinfo:
45+
http-keepalive = 1

0 commit comments

Comments
 (0)