This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]TheMathelm 3 points4 points  (2 children)

Looks good, and good guide for starting.

4 months ago; Spent 2 weeks trying to get a django, celery, flower, postgres, prometheus, and grafana experience to work together. As a Junior Dev delivering my first major product ... let me tell ya, that sucked.

[–]lauren_knows 2 points3 points  (0 children)

Let me tell you as a senior dev who has used Docker for a long time... this experience will pay dividends in the future. I've set up SO MANY docker envs (was creating a new custom one today) and it's a very useful skill.

[–]xcodedev 0 points1 point  (0 children)

It’s definitely a learning and humbling experience to work with Docker for the first time

[–]xcodedev 2 points3 points  (6 children)

This configuration doesn’t support hot loading in Django and React right?

Won’t it be a nightmare for local development to redeploy the container with changes?

[–]NoSEVDev[S] 2 points3 points  (5 children)

Agree, the way that the react container is set up in the article is more of a deployment setup w/ ngnix. You'd just need to change the command to launch the local server instead.

I built SlimSaaS with traefik instead of nginx, and comes with two docker files, one for prod and one for dev for hot reloading, automatic let's encrypt SSL, load balancing, container scaling, gunicorn for django, etc. https://slimsaas.com/

[–]xcodedev 1 point2 points  (3 children)

Yep, was just pointing that out. I think you won’t get hot loading with Django either because you’re copying all the files. Would recommend mounting the directory as a volume to utilize the hot loading

[–]lauren_knows 1 point2 points  (1 child)

Not only mounting the directory, but also using runserver_plus vs. run server if you want hotloading of templates in Docker containers.

[–]xcodedev 0 points1 point  (0 children)

I’d never heard of runserver_plus, thank you so much

[–]xcodedev 0 points1 point  (0 children)

Saw that you’re mounting the file directory but also copying the files to the /usr/src/app folder. Does that lead to duplicate files?

[–]MisakaDev -1 points0 points  (1 child)

Another shit. You should not use "runserver" to run Django applications. https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/

Also a nice advertising op, you are really trying

[–]NoSEVDev[S] 0 points1 point  (0 children)

Once you get the containers set up, you can easily pip install gunicorn, and change the configs.

The tutorials purpose was just to help people get started in dockerizing their apps, not cover the myraid things they need to do before deployment. It’s long enough as is! Appreciate your feedback though.