Modou-dev
Anders (izzno / gooood) π³π΄
There's plenty of guides / tuto / books on how to develop with django but very litle on how to setup a dev/prod evviroment where you can push code and update existing running services. I want to set up an environment where we can deploy changes and or / run a developer versioni all on the same DB, what are the reccomendations around this. to have 2 dockerfiles, one for production and one for development is easy enough but wht/how do you update / develop on an existin gproduct?
Modou-dev
Maz
Anders (izzno / gooood) π³π΄
use heroku
Our code/db will never leave the house so thats not an option.
Eugene
Rajjix
I donβt think itβs a good idea to have same database for both versions, that said iβm no where near publishing a scalable web app, but here are my 2 cents 💰
I usually run 2 different servers on same vps one for production usually nginx and another for development usually apache2 servers are not hard to setup just some configuration stuff, that is to have the same domain work on both serves just different ports they are pretty easy to configure and in case of ssh better to change the port and use rsa instead of password.
Anders (izzno / gooood) π³π΄
I was thinking more in line of docker, Ill wrap the environments in docker then I dont need the "same" db as I can spin up another instance of it making it "the same" but not.
But the automatic push β> deploy solution is the ones I miss more totu / information around.
Anders (izzno / gooood) π³π΄
More like what happens if I generate new fields and models on the dev side, how do i migrate these changes to an active running app? Do I have to do it again in the excact same order ?
Anders (izzno / gooood) π³π΄
I could add the migrate commands to the docker-build fiile so this happens every time the image rebuilds, but again. Whats the common practice / "right" way to do things.
Rajjix
i havenβt use docker, iβm sure uβre smart enough to figure it out and keep us posted on what youβve decided on doing
Anders (izzno / gooood) π³π΄
Sure 👍, if you are unfamilliar with docker i urge you to learn it! It won't take you long and is VERY usefull in many situations.
Rajjix
Itβs on my to learn list, just need time
Anders (izzno / gooood) π³π΄
Anonymous
How do I add extra paths from this base_dir? BASE_DIR = Path(file ).Resolves ().Parent.parent.parent
I've copied this code but I do not know very well how it works, for staic I used BASE_DIR / 'static', but I want to add other extra directories, I tried BASE_DIR / 'dir1' / 'dir2' and BASE_DIR / 'dir1/dir2' but I think that did not work
Anders (izzno / gooood) π³π΄
Who's that?
Anonymous
and how do I configure django to use the static root directory locally? I only get static dirs and using --insecure, but that way I have to restart the server every time I make some changes
Jimmies San
Jimmies San
i not use docker on production btw. only on dev stage
Jimmies San
then with a ci/cd pipeline i deploy all update in different stage before production
Jimmies San
to avoid disruptive update
Rajjix
Jimmies San
😊
Mirco
If I well remember, some of old collegues used to write automatically deploy using Ansible and Makefile to speed up process so make dev, make beta and make prod etc.
Jimmies San
yep. or fabric
Jimmies San
or terraform
Jimmies San
it depends from infra
Rohan
Teach us senpai
Rajjix
please stop β
Rajjix
overwhelmed bar has reached its maximum
Mirco
DevilAstra
Is it sensible to use vagrant and virtual box to deploy our server?
Anders (izzno / gooood) π³π΄
I would say no
Anders (izzno / gooood) π³π΄
I would not run Virtual Box in production.
Anders (izzno / gooood) π³π΄
unless you mean "a" virtual box...
Anders (izzno / gooood) π³π΄
Anders (izzno / gooood) π³π΄
My job upuntil a year ago was a typical multisystem admin, så the admin part is not the problem. Its the CI/CD platform I need to learn. But like you said it depends on the project, and this project will always have the possibility of downtime for upgrades etc without a problem. At least for the unforseeable future.... So docker in production is a real option....
Mirco
Anders (izzno / gooood) π³π΄
I run almost every service in docker. Either with Docker-compose or Docker-machine.
Anders (izzno / gooood) π³π΄
You have other tools like portainer that can help to but I like to keep it in the CLI
Mirco
Me too 😀
Anders (izzno / gooood) π³π΄
😁
Jimmies San
Anders (izzno / gooood) π³π΄
Yes.
Jimmies San
have you stresstested your application with or without docker?
Anders (izzno / gooood) π³π΄
With, these are low traffic services, internal systems etx
Anders (izzno / gooood) π³π΄
Etc
Jimmies San
aaah ok
Jimmies San
'cause with docker i have bad performance
Anders (izzno / gooood) π³π΄
Like phpipam, intranet pages etc
Jimmies San
with cri-o on kubernetes all good, docker with compose or not: a mess :(
Anders (izzno / gooood) π³π΄
Anders (izzno / gooood) π³π΄
What system do you run Docker on?
Jimmies San
i don't think so... the databse is outside docker, clustered, and the files are saved on S3-compatible space
Jimmies San
the service are api, i see a lot of issue on the network part too
Anders (izzno / gooood) π³π΄
You save files outside the container?
Jimmies San
Jimmies San
the container are ephemeral: can die every moment
Anders (izzno / gooood) π³π΄
What kind of files?
Jimmies San
like user uploads
Jimmies San
pdf, img, blabla
Anders (izzno / gooood) π³π΄
Ah yes
Jimmies San
inside the docker only the sourcecode
Anders (izzno / gooood) π³π΄
Jimmies San
Jimmies San
can die in every moment
Jimmies San
it's not a virtualmachine
Anders (izzno / gooood) π³π΄
Not, thats why you should have access to the full resources of the machine and I think its very strange you have issues
Anders (izzno / gooood) π³π΄
I shares kernelspace with the local system... But whats your OS (you tried docker on in production)
Jimmies San
centos
Anders (izzno / gooood) π³π΄
Well that sucks...
Anders (izzno / gooood) π³π΄
Its "no" secret Docker and CentOS have issues.
Jimmies San
🤣🤣🤣
Anders (izzno / gooood) π³π΄
(doesnt suck for everything) hehe
Jimmies San
are you serious?
Anders (izzno / gooood) π³π΄
very
Jimmies San
😂🤣🤣🤣🤣🤣
Anders (izzno / gooood) π³π΄
Check out ubuntu and fedora, I would use Ubuntu