T
T
Troodi Larson2021-09-24 21:56:07
Software Deployment
Troodi Larson, 2021-09-24 21:56:07

Is it correct to organize docker this way?

Recently I work with docker and I chose it because I need to put the same site on many servers (this is a platform). And now I have done this, I wrote a docker-compose file in which all the necessary containers, and also created directories in which configs (volumes) are stored, and the main install.sh file, which, when launched, installs docker on the server, generates ssl certificates, and prepares the environment under dev or prod.
The question itself is: how appropriate is it to have such an architecture, with a lot of directories (10), an installer, an .env file, an archive that is unpacked and compiled (or the code is taken from git to dev), is this normal? I did this because you can deploy everything with one command and the prod is ready.
And the second side question: is it correct that dev and prod work on the same container? I ask this question because the installer generates either a real or a self-signed certificate (depending on what is in .env), or is it better to split it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2021-09-24
@troodi

And the second side question: is it correct that dev and prod work on the same container?

Do you mean from the same docker image? That's how it should be done. To test and run in production the same thing.
Environment-dependent things are configured from the outside and passed through (certificates, database credentials, etc.)
And so - if you are satisfied with the solution, if you understand it and in which case you can easily modify it as you need - yes, quite fine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question