Update create-dev.sh
This commit is contained in:
parent
1f8dc6f641
commit
ef8b3d5e7c
1 changed files with 37 additions and 0 deletions
|
|
@ -1,4 +1,41 @@
|
||||||
|
DOMAIN=$1
|
||||||
|
|
||||||
|
## Install MicroK8s
|
||||||
|
|
||||||
# Check latest channel `snap info microk8s`
|
# Check latest channel `snap info microk8s`
|
||||||
sudo snap install microk8s --classic --channel=1.32/stable
|
sudo snap install microk8s --classic --channel=1.32/stable
|
||||||
|
|
||||||
|
# Adding user to microk8s group missed here
|
||||||
|
|
||||||
|
# Enable modules
|
||||||
|
sudo microk8s enable dashboard
|
||||||
|
sudo microk8s enable ingress
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue