-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands.txt
155 lines (124 loc) · 4.02 KB
/
commands.txt
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
Set up environment for React.js
- installing node.js
> sudo apt install npm
> sudo apt install nodejs
> npm -v
> nodejs --version
> npm cache clean -f
> npm install -g n
> sudo n stable
> nodejs --version
> node -v
> npm -v
> wget https://nodejs.org/dist/v14.15.0/node-v14.15.0-linux-x64.tar.xz
> sudo apt-get install xz-utils
> sudo tar -xJf node-v14.15.0-linux-x64.tar.xz -C /usr/local --strip-components=1
> sudo apt-get remove nodejs
> sudo ln -s /usr/local/bin/node /usr/bin/nodejs
- creating react.js app
> npx create-react-app keeper-ui
> cd keeper-ui
> npm start
> npm install react-router-dom
- installing visual studio code
> sudo snap install --classic code
> npm install @material-ui/core
> npm install @material-ui/icons
- installing python3 and flask.
> sudo apt install python3-pip
> pip3 install flask
> pip3 install flask_restful
> pip3 install flask_cors
> pip3 install pymongo
- installing docker and docker-compose
> sudo apt-get update
> sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
> curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
> sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
focal \
stable"
> sudo apt-get update
> sudo apt-get install docker-ce docker-ce-cli containerd.io
> sudo docker run hello-world
- installing docker compose
> sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
> sudo chmod +x /usr/local/bin/docker-compose
> docker-compose --version
- installing mongo db
> curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -
> echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
> sudo apt update
> sudo apt install mongodb-org
> sudo systemctl start mongod.service
> sudo systemctl status mongod
> sudo systemctl enable mongod
> mongo --eval 'db.runCommand({ connectionStatus: 1 })'
> sudo systemctl status mongod
> sudo systemctl stop mongod
> sudo systemctl start mongod
> sudo systemctl restart mongod
> sudo systemctl disable mongod
> sudo systemctl enable mongod
> mongod --version
> cd keeper-app/backend
> touch docker-compose.yml
> mkdir api
> mkdir db
> touch api/Dockerfile
> touch db/Dockerfile
> touch api/requirements.txt
> touch api/app.py
> code .
> sudo docker-compose build
> sudo docker-compose up
> sudo docker-compose up -d
- installing postman
> sudo snap install postman
> postman &
> initialize git
> sudo apt-get install git
>
- create an EC2 instance on AWS
- connect EC2 using ssh
> sudo chmod 400 KeeperAppUbuntuServer.pem
> sudo ssh -i ./otherfiles/KeeperServer.pem [email protected]
- creating git repository on GITHUB.
> git init
> git remote add origin https://github.com/repository-name
> git status
> git add .
> git config --global user.email "email.address"
> git config --global user.name "username"
> git commit -m "Initial commit"
> git push origin master
>
- setting up environment on AWS.
- installing required programs.
--install docker
--configure in app.py
app.run(debug=False, host='0.0.0.0', port=80)
- building react app
> npm run build
- public a react application to GitHub Pages
- https://create-react-app.dev/docs/deployment/#github-pages
- Step 1: Add homepage to package.json
- "homepage": "https://myusername.github.io/my-app",
- Step 2: Step 2: Install gh-pages and add deploy to scripts in package.json
- npm install --save gh-pages
- Add the following scripts in your package.json:
"scripts": {
+ "predeploy": "npm run build",
+ "deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
- Step 3: Deploy the site by running npm run deploy
- npm run deploy
- Step 4: For a project page, ensure your project’s settings use gh-pages
- deployment
https://testdriven.io/blog/dockerizing-flask-with-postgres-gunicorn-and-nginx/