V
V
Vasily Terkin2017-10-09 19:10:10
Django
Vasily Terkin, 2017-10-09 19:10:10

How to pass config as python code to docker container?

Gentlemen, there is approximately the following solution to one problem.
Task:
storage of different configs, start/stop of program instances with these configs, visibility of the instance execution log, all through the web interface.
Solution:
django - storing configs, managing the launch of instances in a docker cluster (+ portainer)
docker - building images to launch the application (it is updated periodically)
That is, I want to store some application config in the form of python code (there is a lambda expression) in django ORM and run a docker container with this config, and from the same junga control the stop / start of containers through the docker api.
I understand that the task can be simplified and in general there are errors in the architecture, but the goal is to gain some experience with docker, CI \ CD and all that.
The question is, how can I best pass python code to an application in docker, if the application itself must initialize it before starting work?
The structure of the python config is just dictionary initiations.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Abdulla Mursalov, 2017-10-09
@amaprograma

Docker SDK for Python

S
scor2k, 2017-10-10
@scor2k

I would write some start script in docker that would download your python app from a fixed location on startup.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question