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.
Solution:
fabulous thank you!
Jump to solution
5 Replies
nerdylive
nerdylive6mo ago
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!
Thalia (HMG)
Thalia (HMG)OP6mo ago
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.
nerdylive
nerdylive6mo ago
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
Thalia (HMG)
Thalia (HMG)6mo ago
fabulous thank you!
nerdylive
nerdylive6mo ago
no problem
Want results from more Discord servers?
Add your server