Skip to content

Backend deploy shell script

Ryou_Changyu edited this page Dec 10, 2020 · 1 revision
#! /bin/bash
  
echo
echo -e "\033[47;31m move to backend directory  \033[0m"
cd ./Projec*/backend
echo $SHELL_PATH

echo
echo -e "\033[47;31m pull repository \033[0m"
git pull origin master

echo
echo -e "\033[47;31m stop docker container \033[0m"
sudo docker stop backend

echo
echo -e "\033[47;31m remove docker image & container \033[0m"
sudo docker stop $(sudo docker ps -a -q)
sudo docker rm $(sudo docker ps -a -q)
sudo docker rmi $(sudo docker images -q)


echo
echo -e "\033[47;31m build docker image \033[0m"
sudo docker build -t backend .

echo
echo -e "\033[47;31m docker run container \033[0m"
sudo docker run -d -p 4000:4000 -p 5000:5000 --name backend backend

๐Ÿท๏ธ Slack C

๐Ÿ“ƒ Documents

๋ฐ์ผ๋ฆฌ ์Šคํฌ๋Ÿผ

ํ”ผ์–ด ์„ธ์…˜

๊ณ ๋ฏผ๊ฑฐ๋ฆฌ

๊ทธ๋ฃน ํšŒ๊ณ 

Clone this wiki locally