-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_prod_linux.sh
More file actions
44 lines (36 loc) · 1.18 KB
/
Copy pathdeploy_prod_linux.sh
File metadata and controls
44 lines (36 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
#===============================================================================
#
# SERVER DEPLOYMENT
#
# @author: Alberto Naperi Jr.
#
#===============================================================================
echo -e ""
echo -e "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
echo -e "* *"
echo -e "* SCRIPT INFO: Deploying prod nodejs-assessment. *"
echo -e "* *"
echo -e "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n"
# Remove files/folder
echo "Removing old files..."
rm -rf Dockerfile
rm -rf node_modules
# Copy files
echo "Copying new files..."
cp -r .env-prod .env
cp -r dockerfile-prod Dockerfile
# Run docker
docker rm -f nodejs-assessment
docker rmi nodejs-assessment
docker build -t nodejs-assessment .
docker run \
--name nodejs-assessment \
--restart=always \
-p 127.0.0.1:9001:9001 \
-v /opt/.pm2/nodejs-assessment:/opt/.pm2/nodejs-assessment \
-v /etc/timezone:/etc/timezone \
-v /etc/localtime:/etc/localtime \
-d \
nodejs-assessment
# End