Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Containerless Django
Search
Peter Baumgartner
October 16, 2018
Programming
1.9k
5
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Containerless Django
Deploying Django without Docker
Peter Baumgartner
October 16, 2018
Transcript
43 slides
DjangoCon US—San Diego Oct 2018 Deploying without Docker Containerless Django
Peter Baumgartner
Founder at Lincoln Loop—lincolnloop.com Former SysAdmin, DevOps for 8 years
Author of High Performance Django About Me
Docker is cool!
@ipmb | #djangocon Docker is cool! The “pipeline” Security Isolation
Dev/prod parity
Just bundle the entire OS
Some philosophy
“ —Mike Perham https://www.mikeperham.com/2016/02/09/kill-your-dependencies/ No code runs faster than no
code. No code has fewer bugs than no code. No code uses less memory than no code. No code is easier to understand than no code. “
None
@ipmb | #djangocon Docker Drawbacks Slow Extra abstractions More software,
more problems
None
How did we get here?
@ipmb | #djangocon Deployments sucked Dependencies would shift underneath you
Build tools and dev packages needed to be installed Multiple languages, multiple builds (Python & Node)
@ipmb | #djangocon The ideal deployment Download a binary Create
a configuration file Run it
@ipmb | #djangocon The ideal deployment /usr/local/bin/traefik \ --configFile=/etc/traefik/traefik.toml /usr/local/bin/telegraf
\ --config=/etc/telegraf/telegraf.conf /usr/sbin/nginx -c /etc/nginx/nginx.conf
@ipmb | #djangocon Python isn’t C or Go Requires a
VM Dynamic linking Packaging isn’t straightforward
None
Can we do better?
@ipmb | #djangocon We already are! Lock files via pipenv
or poetry Pre-compiled wheels (Pillow, psycopg2-binary, etc.) Still lots of holes - Assembling virtualenvs - Static files - Production webserver
@ipmb | #djangocon Prior art Private PyPI virtualenv-clone Platter dh-virtualenv
Pex
@ipmb | #djangocon ZIP applications? Part of Python since 2.6
PEP-441 improves support in 3.5 Create a ZIP archive of your project. Run it with Python. …but no mechanism for handling dependencies
None
@ipmb | #djangocon Enter shiv! A project from LinkedIn Zipapps
with dependencies A single artifact you can build → test → deploy ./myproject.pyz runserver
Django as a zipapp
Package your project with setup.py
@ipmb | #djangocon Include templates & static files Create a
MANIFEST.in graft your_project/collected_static graft your_project/templates
@ipmb | #djangocon Production webserver gunicorn + whitenoise ⭐ https://pypi.org/project/django-pyuwsgi/
@ipmb | #djangocon Build your zipapp
@ipmb | #djangocon Run your zipapp ./yourproject.pyz pyuwsgi --http=:8000
@ipmb | #djangocon Configuration Same zipapp, but different settings per
environment Options: - Multiple settings files and DJANGO_SETTINGS_MODULE - Environment variables - ⭐ https://pypi.org/project/goodconf/
@ipmb | #djangocon The zipapp pipeline Use CI (Travis, CircleCI,
Bitbucket, etc.) to: - Build - Test - Push Deploy = Download and run
None
What about security?
Systemd's got your back
@ipmb | #djangocon Systemd is awesome ProtectSystem=strict ProtectHome=true DynamicUser=true CapabilityBoundingSet=~CAP_SYS_ADMIN
AppArmorProfile=srv.yourproject.pyz ProtectKernelTunables=true ProtectControlGroups=true ProtectKernelModules=true PrivateDevices=true PrivateTmp=true SystemCallArchitectures=native
What about isolation?
@ipmb | #djangocon Isolation You still need Python installed globally
Easy to install multiple Pythons on one server Docker has better isolation, but do you need it?
@ipmb | #djangocon What about parity? Zipapp is the same
from CI to all deployed environments Use Docker to mimic deployment envionrment locally (or don't)
@ipmb | #djangocon Pros Simpler. No Docker on the server.
No registry. ~1M fewer lines of code to depend on. Smaller artifacts Faster deployments It's just Python
@ipmb | #djangocon Cons Not as isolated as true containers
Requires Python runtime on the server Python-specific Not cross-platform compatible (if you have packages with C extensions)
@ipmb | #djangocon Sweet spot for zipapps You are deploying
primarily Python services You have outgrown PaaS (Heroku, PythonAnywhere, Divio, etc.) You have fewer than 50 services to maintain
None
None
Thanks! Peter Baumgartner
[email protected]
@ipmb
More Decks by Peter Baumgartner
See All by Peter Baumgartner
High Performance Django at Ten
ipmb
0
87
Just Enough Ops for Developers
ipmb
0
360
Prepping Your Project for Production
ipmb
2
950
Django Deployments Done Right
ipmb
6
1.6k
High Performance Django: From runserver to Reddit hugs
ipmb
1
1.5k
Getting Started with Salt (PyCon 2014)
ipmb
6
1.4k
Monitoring Infrastructure with SaltStack
ipmb
16
10k
Getting Started with Salt
ipmb
11
1.7k
Other Decks in Programming
See All in Programming
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
410
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
690
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
180
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
340
imagewebp()の向こう側: WebPはなぜ JPEG・PNGより軽いのか
yuzneri
0
150
Getting Started with Vibe Coding
miccheng
0
250
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
340
How SRE Grew Out of Server-Side Work and Became the Team's Own / サーバサイドから始まったSREを チームに渡すまで
maaaato
1
270
SODA - FACT BOOK(EN)
sodainc
1
290
はじめてのPLATEAU
nokonoko1203
1
670
はじめてのKubernetesコントリビューション
nasa9084
0
330
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.7k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
480
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
390
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
850
The Limits of Empathy - UXLibs8
cassininazir
2
800
The Mindset for Success: Future Career Progression
greggifford
PRO
0
570
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
620
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
320
Site-Speed That Sticks
csswizardry
13
1.6k
Crafting Experiences
bethany
1
460