Skip to content

Commit

Permalink
Merge pull request #6 from mniYUNSU/dev
Browse files Browse the repository at this point in the history
[Server] / #2 / deploy : sh ํŒŒ์ผ ์ถ”๊ฐ€
  • Loading branch information
minjman2659 authored Aug 25, 2021
2 parents 062e376 + 9299ab2 commit 2a81cd7
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.env
client/node_modules
server/node_modules
server/node_modules
16 changes: 16 additions & 0 deletions appspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/Jurimma

hooks:
ApplicationStop:
- location: scripts/stop.sh
runas: root
AfterInstall:
- location: scripts/initialize.sh
runas: root
ApplicationStart:
- location: scripts/start.sh
runas: root
9 changes: 9 additions & 0 deletions scripts/initialize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
cd /home/ubuntu/Jurimma/server
npm install
npm install pm2@latest -g
sudo apt-get update
sudo apt-get install authbind
sudo touch /etc/authbind/byport/80
sudo chown ubuntu /etc/authbind/byport/80
sudo chmod 755 /etc/authbind/byport/80
3 changes: 3 additions & 0 deletions scripts/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cd /home/ubuntu/Jurimma/server
authbind --deep pm2 start app.js
4 changes: 4 additions & 0 deletions scripts/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
cd /home/ubuntu/Jurimma/server
pm2 stop app.js 2> /dev/null || true
pm2 delete app.js 2> /dev/null || true

0 comments on commit 2a81cd7

Please sign in to comment.