R
R
Roman Kitaev2018-07-09 10:20:46
Backend
Roman Kitaev, 2018-07-09 10:20:46

How do you develop with Docker?

Hello. I've been developing django + vuejs in Docker + docker-componse for a long time and I feel like there is some concise way to simplify the current scheme.
Now the scheme is as follows:
1. Container with janga based on python:alpine. It has two folders: /app and /app_autobuild. Files get into /app_autobuild when the image is built. Files from the local machine are synchronized in /app by composition and a variable is passed to env that launches gunicorn in the /app folder on the local machine and /app_autobuild on the prod. It is felt that it is possible to do something cunningly so that there is no duplication of folders.
2. There is a container with frontend and nginx, multi-stage build. First, statics are built from the vue application in the container with the node, then an image is created from nginx:alpine, where the result of the front build (dist) is copied from the previous image, and all this is distributed along with proxying to djanga.
3. There is a container (which, it seems to me, can be liquidated) with a node, it is only for the dev-environment, where the local dist is synced and from there it is distributed with janga. (Yes, on the dev environment, jang distributes all the statics)
The question is: how do you arrange containers so that it is convenient for both development and sales? Perhaps you should use two Dockerfiles for django + two for the front: one pair for the dev environment, one for the prod? Perhaps the docker-compose config allows you to include folders depending on env variables? I would like to know some best practices for all this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
m0nym, 2018-07-09
@m0nym

Docker Compose is not for sale, that's it.
More suitable tools, where all your problems have already been solved - Flynn or, more complicated, Kubernetes.
And yes, there is a Docker inside them.
However, it is not necessary to switch to Compose, it is enough to look at the ideology described above.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question