-
Notifications
You must be signed in to change notification settings - Fork 18
/
setup.sh
executable file
·36 lines (30 loc) · 1.15 KB
/
setup.sh
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
#!/bin/sh
# Install NodeJs
if [ -z `which node` ]; then
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
fi
# Install docker
if [ -z `which docker` ]; then
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
fi
# Build Project
npm install
# Build docker container image
sudo docker build -t compiler ./container
# Run doctor container
sudo docker run -dit -v /tmp:/compiler --network none --name compiler-container compiler
# Start docker container
sudo docker start compiler-container