scripts/create-dev.sh
2025-05-17 11:57:05 +00:00

46 lines
No EOL
898 B
Bash

#!/bin/bash
DOMAIN=$1
## Install MicroK8s
./install-microk8s.sh
## Install NGINX
sudo apt install -y nginx
# Install Certbot
sudo apt install -y certbot python3-certbot-nginx
# Setup nginx config
sudo sed -i "s/server_name _/server_name ${DOMAIN}/" /etc/nginx/sites-available/default
sudo systemctl reload nginx
sudo certbot --nginx -d ${DOMAIN}
# Apply proxy pass config
PROXY_PASS_CFG='\
proxy_set_header Host $host; \
proxy_pass http:\/\/127.0.0.1; \
proxy_set_header Connection ''; \
proxy_http_version 1.1; \
chunked_transfer_encoding off; \
proxy_buffering off; \
proxy_cache off; \
'
sudo sed -i "s/try_files \$uri \$uri\/ =404;/$PROXY_PASS_CFG/" /etc/nginx/sites-available/default
## Install Docker
# --
## Run standalone
# Run postgres
# Run redis
# Run rabbit