Closed Andrej730 closed 4 years ago
Not yet. I was planning on redoing the cron feature outside of the Node app to reduce idle memory usage. It should take it from ~100MB to ~3MB while idling. I can add a feature to not idle (stop the container) along with that.
I prefer to schedule script executions outside the script - I'm using crontab for that purpose. So, the option to stop script after it was executed would work great for me. My current workaround is to schedule removing container after an hour of the script execution.
See the new RUN_ONCE
variable. It should be used in conjunction with RUN_ON_STARTUP=true
for this use case.
I'm getting the following error after the last commit:
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"/usr/app/entrypoint.sh\": permission denied": unknown. ERRO[0000] error waiting for container: context canceled
It seems like the solution is to add this line to dockerfile (according to similar issues like https://github.com/arangodb/arangodb-docker/issues/54 or https://github.com/passbolt/passbolt_docker/issues/8 )
RUN ["chmod", "+x", "/usr/app/entrypoint.sh"]
I tested this 50 times locally, but I guess the git permissions caught me. Looks like https://github.com/claabs/epicgames-freegames-node/commit/3ca7fa81de1cfe0ad88d5dd85b85f391d9d02fa1 fixed it. The new image is already built.
Is there option to stop script docker container after the script was executed?