SyP-

static-nginx-deploy

Oct 14th, 2020
1,291
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3.  
  4. read -p "Nombre del sitio: " SITE
  5. echo ""
  6. read -p "Puerto (host): " PORT
  7. echo ""
  8.  
  9. # Lanzamos contenedor
  10.  
  11.  
  12. docker run -d -v "/var/volumes/$SITE":/var/www/html --name $SITE -p $PORT:80 nginx
  13.  
  14. docker cp ./default.conf $SITE:/etc/nginx/conf.d/default.conf
  15.  
  16. docker exec $SITE service nginx reload
  17.  
  18. echo "<h1>Este conetendor es para el sitio $SITE" > index.html
  19.  
  20.  
  21. sudo cp ./index.html /var/volumes/$SITE
  22.  
RAW Paste Data