What are you using in production? #3419
-
When you develop a new project using django cookiecutter, what do you use for production deployments? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Can you describe your release proces? I do the same once a while and in my situation it does not take 3 to 5 minutes to deploy a new version. There is some downtime but not more than 60 seconds I think. The actual update command I use is Nowadays I make use of a single VPS (4cpu, 8gb ram) to host a docker-swarm instance for multiple sites and apps. There is an excellent tutorial about this on https://dockerswarm.rocks/. In swarm mode you can use the services:
django:
<<: *default-opts
command: /start
healthcheck:
test: /bin/bash -c "timeout 1 bash -c '</dev/tcp/localhost/5000' 2>/dev/null"
start_period: 20s
interval: 30s
timeout: 30s
retries: 5
deploy:
restart_policy:
condition: any
delay: 5s
max_attempts: 24
rollback_config:
parallelism: 0
order: stop-first
update_config:
order: start-first
failure_action: rollback
delay: 10s |
Beta Was this translation helpful? Give feedback.
-
I have made my custom github-actions workflow to push the code to my server automatically. Basically, it logins via ssh and performs docker-compose commands. With this method, I hardly get downtime of ~10sec or even less!! |
Beta Was this translation helpful? Give feedback.
-
I build images (frontend and backend) on GitHub via actions, from there push to Image Repo on GitLab ( 5GB free ). Once push is done, GH actions continues and SSH into VM and execute few commands, that boil down to |
Beta Was this translation helpful? Give feedback.
Can you describe your release proces? I do the same once a while and in my situation it does not take 3 to 5 minutes to deploy a new version. There is some downtime but not more than 60 seconds I think.
The actual update command I use is
docker-compose -f production.yml up -d django celeryworker
. Before I run that command I pull the new images from a registry and run the migrations with the new image. Before I was using an online registry I was building the images on the server which caused a lot of trouble.Nowadays I make use of a single VPS (4cpu, 8gb ram) to host a docker-swarm instance for multiple sites and apps. There is an excellent tutorial about this on https://dockerswarm.rocks/.…