deploy nuxt caddy

This commit is contained in:
Valentin 2024-02-25 17:18:43 +01:00
parent cce95dc9e4
commit 8d2ead39ab
1 changed files with 10 additions and 0 deletions

View File

@ -322,6 +322,7 @@ echo -e "${PURPLE}${BOLD}Install the front-end ? (y/N) ${RESET}"
read answer
if [[ "$answer" == "y" ]]; then
get_username
get_ip
echo -e "${PURPLE}${BOLD}Create and push a prod branch on the repo${RESET}"
echo -e "${PURPLE}git checkout -b prod${RESET}"
@ -350,6 +351,15 @@ if [[ "$answer" == "y" ]]; then
tmux send-keys -t front \"cd /home/${username}/${front_folder} && node .output/server/index.mjs\" C-m &&\
tmux send-keys -t directus "npx directus start" C-m" $username
caddyfile="/etc/caddy/Caddyfile"
echo "www.${domain_name} {" >> $caddyfile
echo "redir ${domain_name}{uri} permanent" >> $caddyfile
echo "}" >> $caddyfile
echo "${domain_name} {" >> $caddyfile
echo "reverse_proxy ${ip}:3000" >> $caddyfile
echo "}" >> $caddyfile
caddy fmt $caddyfile -w
caddy reload -c $caddyfile
echo -e "${PURPLE}${BOLD}Setup a webhook ? (y/N) ${RESET}"
read answer