question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Moving from gunicorn to uwsgi in Dockerfile

See original GitHub issue

Using uwsgi instead of gunicorn has some advantages, like having cronjobs and it’s configureable with an uwsgi.ini

[uwsgi]
http =  0.0.0.0:8000
master = True
processes = 8
threads = 2
module = <projectname>.wsgi
gid = www-data
uid = www-data
# Once an hour
cron = -0 -1 -1 -1 -1 python manage.py update_index
cron = -0 -1 -1 -1 -1 python manage.py publish_scheduled_pages
# Once a day
cron = -0 -0 -1 -1 -1 python manage.py search_garbage_collect

I can open a PR if you are interested in

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
tomdysoncommented, Jun 29, 2018

Thanks @Speedy1991! I knew uwsgi could handle cronjobs but I didn’t realise that it could all be configured in a single file like this.

I don’t think we should switch from Gunicorn - our intention with the Dockerfile was to provide the simplest working template for Docker-based deployments, rather than an our opinion on best practices, which are often controversial and quickly outdated.

However, it would be great to take advantage of your expertise in this area. Would you consider one or more of

  • submitting a PR to wagtail/bakerydemo
  • submitting a PR to the Wagtail docs, e.g. a new Docker section in the Deployment page
  • writing a blog post with a recipe for uwsgi config for Wagtail, either on your blog or on wagtail.io

?

0reactions
Speedy1991commented, Sep 23, 2018

Forgot this issue - this will be the gist to follow: https://gist.github.com/Speedy1991/8d2783a90562e098c0d9220b260b13f8

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker how to Django + uwsgi/gunicorn + nginx? - Server Fault
I'm currently building a django app the way you want. I use docker-compose to do this. This is my docker-compose.yml
Read more >
Do you still use gunicorn or uwsgi in your containers ? : r/docker
I use gunicorn/uwsgi extensively for systemd services. Does it make sense to continue to use them inside containers ?
Read more >
Dockerizing Django with Postgres, Gunicorn, and Nginx
This tutorial details how to configure Django to run on Docker along with Postgres, Nginx, and Gunicorn.
Read more >
How to Deploy old Django project using NGINX, Docker and ...
How does a regular Django project structure look like for UWSGI · How to package the Django app in a Docker container along...
Read more >
Deploying Django with Docker Compose, Gunicorn and Nginx
How to deploy a Django project in a production environment using Docker Compose.Django is run in production using a WSGI server such as ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found