Skip to content

Instantly share code, notes, and snippets.

@joshlopes
Last active September 20, 2023 06:49
Show Gist options
  • Save joshlopes/9cabfad04149758f1e479bf5d52577e8 to your computer and use it in GitHub Desktop.
Save joshlopes/9cabfad04149758f1e479bf5d52577e8 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ -n $PASS_SSH ]]
then
apt-get install -y ssh
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config && (echo $PASS_SSH; echo $PASS_SSH) | passwd root
service ssh start
fi
if [[ -n $SSH_KEY ]]
then
apt-get install -y ssh
mkdir /root/.ssh
echo $SSH_KEY > /root/.ssh/authorized_keys
service ssh start
fi
ufw allow 80,443,3000,996,7946,4789,2377/tcp; ufw allow 7946,4789,2377/udp;
ufw --force enable
mkdir /root/captain
docker run -p 80:80 -p 443:443 -p 3000:3000 -e ACCEPTED_TERMS=true -v /var/run/docker.sock:/var/run/docker.sock -v /root/captain:/captain caprover/caprover
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment