There is a web site on Django, on the combat server, I use the uWSGI / Nginx bundle for the launch server, the local development is the Django virtualenv / dev server

I decided to touch the Docker-technology to launch applications and in the process of reading a question appeared.

If I create a Docker-image of the project, can I run it on the usual uWSGI / Nginx bundle? Or will my files be "hidden" inside the Docker image, as in a black box, and accessible only through specific commands?

  • 2
    Treat the docker like a small virtual machine / vps. If you can implement your idea on a vps group, you will most likely do it in a docker. - KoVadim

1 answer 1

Your services with all dependencies will be packed in a container and isolated from the rest of the processes on the system in which you run the container. But you can configure the container and the host system so that some of the files will be available outside the container.

Containerization provides convenient distribution of your service and ease of launch.

In your case, inside the container there will be uWSGI / Nginx (although this is optional), Python, Django and your own code. Outside the container will expose several ports - 80, 443. Plus, you will need to add a link (link) to the container from the database (although the database may not be in the container)

You can run this container on any system (as much as possible "bare") on which Docker is installed. Docker is the only dependency.

  • That is, in the usual understanding of the directory tree and files will not be, we assume, on the 80th port of the container we will send a request and receive a response? - while1pass
  • "part of files" - are you talking about file forwarding now? - while1pass
  • one
    Files and directories will not go anywhere, they will just be on a "separate" disk. You can also mount the host directory / file and / or volume of another container inside the container. - Mikhail Vaysman
  • Thank you, you open a new world to me. Can we put a db in the image? and why did you say "add a link to the container from the database"? isn't the database on the host or in the container itself? - while1pass
  • here another question appeared. What to include in the Docker image ru.stackoverflow.com/questions/612160/… - while1pass