Update README.md #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Setup Ubuntu VM with SSH, Bore, and Ollama | |
on: [push] | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Install Bore | |
run: | | |
wget https://github.com/ekzhang/bore/releases/download/v0.5.1/bore-v0.5.1-x86_64-unknown-linux-musl.tar.gz | |
tar -xzf bore-v0.5.1-x86_64-unknown-linux-musl.tar.gz | |
chmod +x ./bore | |
- name: Install SSH Server | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y openssh-server | |
sudo systemctl enable ssh | |
sudo systemctl start ssh | |
- name: Create SSH User | |
run: | | |
sudo adduser --quiet --disabled-password --shell /bin/bash --home /home/sshuser --gecos 'SSH User' sshuser | |
echo "sshuser:P@ssw0rd2024" | sudo chpasswd | |
sudo usermod -aG sudo sshuser | |
- name: Open SSH Port in Firewall | |
run: | | |
sudo ufw allow 22/tcp | |
sudo ufw reload | |
- name: Install Docker and Docker Compose | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get update | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io | |
sudo usermod -aG docker $USER | |
sudo systemctl enable docker | |
sudo systemctl start docker | |
sudo curl -L "https://github.com/docker/compose/releases/download/v2.14.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose | |
- name: Install Ollama and Run Llama 3 Model | |
run: | | |
docker pull ollama/ollama | |
docker run -d --name ollama-server -p 11434:11434 ollama/ollama | |
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main | |
- name: Start Bore for SSH and Ollama | |
run: | | |
./bore local 22 --to bore.pub & | |
./bore local 11434 --to bore.pub & | |
./bore local 3000 --to bore.pub & | |
wait |