[Vapor4.0]deploy App on Server

Just record the steps how I deploy my vapor project on the server.

Step 1: Install Docker

1
2
curl -fsSL get.docker.com -o get-docker.sh
sh get-docker.sh

Step2: Start Docker

1
2
3
4
sudo systemctl enable docker
sudo systemctl start docker
sudo groupadd docker
sudo usermod -aG docker $USER

Step3: Install docker compose

1
2
3
sudo curl -L https://github.com/docker/compose/releases/download/1.25.5/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

Step4: copy the source code into the server.

1
scp Dreamoji-server root@144.202.101.94:~

Step5: unzip the source code.

1
2
apt install unzip
unzip Dreamoji-server.zip

Step6: build & run

1
2
3
cd Dreamoji-server
docker-compose build
docker-compose up app