I try to execute a python when the container start.
I use crontab in the container:
crontab -l
@reboot python3.10 /opt/django/manage.py runserver 0.0.0.0:8002
But when I stop and start container with portainer the python didn’t execute
I try to execute a python when the container start.
I use crontab in the container:
crontab -l
@reboot python3.10 /opt/django/manage.py runserver 0.0.0.0:8002
But when I stop and start container with portainer the python didn’t execute
2
Answers
Thanks I could resolve the problem I used the command:
The way you’re trying to do this is not correct. Go to python image page on Docker hub, get the Dockerfile
Then build your image. The script will start on container startup.