Reputation: 77
i have a program which fetches the python code as string. How can i get it executed in python container every time it is fetched and get the output back to local??
Upvotes: 3
Views: 278
Reputation: 1929
You may do this via docker yml (docker-copose)
services:
server:
command: bash -c "python3 manage.py migrate; python3 manage.py runserver 0.0.0.0:8000; tail -f /dev/null;"
ports:
- "8000:8000"
Or in Dockerfile:
RUN python3 manage.py migrate
If the python code is a string maybe try using EVAL command:
https://www.programiz.com/python-programming/methods/built-in/eval
Upvotes: 1