Installer un PaaS avec CapRover
Publié le - 28 juillet 2023 par Andy Cinquin
Installation de base VPSSécurité avec UFW et Fail2BanConfiguration SSH DebianCapRover sur ContaboDocker et containerisationGitHub Secrets pour CI/CDDebug Docker et logs ApacheCréation utilisateur LinuxAccès sécurisé avec clés SSHConfiguration OVH CloudNode.js et npm installationCommandes Linux essentiellesGestion de serveurs dédiésInstallation de tmux et vimDéploiement d'application web
Base install
ssh root@142.242.222.142
apt install sudo -y
apt install ufw -y
apt install tmux -y
apt install git -y
apt install fail2ban -y
apt install vim -y
useradd Andy -m -s /bin/bash
usermod-aG sudo Andy
passwd Andy
// ajouter une clé ssh
cd /home/Andy/
mkdir .ssh
vim /home/Andy/.ssh/authorized_keys
(mettre la clé ssh publique dedans)
cd /home/Andy
chown Andy:CinquinAndy .ssh/ -R
chmod 755 -R .ssh/
chmod 600 .ssh/authorized_keys
vim /etc/ssh/sshd_config
// changer :
// -> PubkeyAuthentification
// -> PasswordAuthentification
// -> PermitRootLogin
// -> AuthorizedKeysFile

// -> PubkeyAuthentification
// -> PasswordAuthentification
// -> PermitRootLogin
// -> AuthorizedKeysFile

Ufw
ufw allow 53
ufw allow 443
ufw allow 22
ufw enable
Cap Rover
Prerequis :
sudo ufw allow 80,443,3000,996,7946,4789,2377/tcp;
sudo ufw allow 7946,4789,2377/udp;
Conf OVH:


sudo apt install curl
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt install nodejs
npm install -g caprover
caprover serversetup
config captain

Ajouter une application
Conteneriser son app
docker build -t andycinquin/second-brain .
docker run -d -p 8000:8000 andycinquin/second-brain
~ push son app sur dockerhub
docker login
docker tag second-brain andycinquin/second-brain
docker push andycinquin/second-brain
Créer les secrets sur github
APP_IMAGE
APP_NAME
APP_TOKEN
APP_URL
docker.io/andycinquin/songflow-prod:latest
APP_NAME
songflow
APP_TOKEN
$token de caprover
APP_URL
captain.beta.andy-cinquin.fr
DOCKER_PASSWORD
DOCKER_USERNAME
password de docker.io
DOCKER_USERNAME
username de docker.io
Debug :
docker ps
docker exec -it {numerodedocker} bash
tail -f /var/log/apache2/access.log -n 100

🚀 Merci d'avoir lu jusqu'ici !
Si cet article vous a plu, partagez-le autour de vous.
💡 Une idée en tête ? Discutons-en !☕