How to deploy django-q with docker?
See original GitHub issueAssume this simple docker-compose file
version: "3.9"
services:
redis:
image: redis:alpine
ports:
- 6379:6379
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- redis
How can i add django-q process to handle all requests from web
container? I could probably build same image with different command such as python manage.py qcluster
but I dont think this solution si elegant. Could you suggest some approach how to do that?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Dockerizing a Python Django Web Application - Semaphore CI
Dockerizing a Python Django Web Application ; Click on Edit Workflow. Click on + Add Block. Set the name of the block to...
Read more >Django samples - Docker Documentation
Compose and Django, This quick-start guide demonstrates how to use Docker Compose to set up and run a simple Django/PostgreSQL app.
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 >Deploying Django with Docker Compose - YouTube
How to deploy a Django app to an EC2 instance using Docker Compose.Find the blog post for this tutorial here: ...
Read more >How to Deploy a Django Application with Docker - DZone
Create Docker file · FROM - initializes a new build stage and sets the Base Image for subsequent instructions. · RUN - runs...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You need to run 2 docker containers. One for application server and one for django-q service. Your dockercompose file will look like this.
I have a question to this topic:
How can I serve environment variables (with os.environ[]) from a file to the settings.py with docker? It is working for my app but Django Q does not take those values and gave me errors like:
djangoq_1 | raise ImproperlyConfigured(“The SECRET_KEY setting must not be empty.”) djangoq_1 | django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
djangoq_1 | ALLOWED_HOSTS = os.environ.get(“DJANGO_ALLOWED_HOSTS”).split(" ") djangoq_1 | AttributeError: ‘NoneType’ object has no attribute ‘split’