container start command
I have created a startup.sh script that I want to use as the start command for my container. The script needs to do two things:
Start a Python .py file
Keep the container accessible through the web terminal after starting the Python script
What should be the final command in my startup.sh script to achieve this? I understand that the script should point to an executable with +x permissions.
5 Replies
CMD / ENTRYPOINT
ENTRYPOINT /bin/bash -c yourscript.sh
Ohh, srry that was to launch the script.
but about the script, im not sure what service will you be using to keep the container accessible through web terminal?
usually services like jupyter, kasm( dekstop ), or custom build apps that serves http just expose them in the http port and then it works!my current start script just copys some files and ends. pod is not accessible after that via the web terminal
I've tried ending the script with "bash" but the results are the same.
i'm tempted to use something like "bash &" but im tired of trying things that end up not working.
Maybe the ssh is dead because of the start script
if you changed the start script, try to add this after:
service ssh start;sleep infinity
@Thalia (HMG)
full command from docs:
bash -c 'apt update;DEBIAN_FRONTEND=noninteractive apt-get install openssh-server -y;mkdir -p ~/.ssh;cd $_;chmod 700 ~/.ssh;echo "$RUNPOD_SSH_PUBLIC_KEY" >> authorized_keys;chmod 700 authorized_keys;service ssh start;sleep infinity'
Solution
fabulous thank you!
no problem