Skip to main content

Deployment

Hosting

All our repositories or code-bases are hosted on one server. They run internally on different private access ports using PM2 and then are exposed globally via port :80. We use a linux tool called NginX to redirect different HTTPS request to different ports then using a .conf file.

Server

We at heiphen like many other companies use Amazon Web Services AWS, hence we use EC2 instance bundled with and ElasticIP for our code-bases.

Deployment

Once all current issues have been resolved and our code-base is ready to be deployed, all we need to do is ssh into the EC2 Instance and run our custom deploy.sh file, which basically pulls the latest version of the master branch using the Git tool and then redeploys it using PM2

Sample .conf File

# listens for requests made via api.cheeez.xyz and redirects them to 
# localhost:3001
server {
listen 80;
listen [::]:80;

server_name api.cheeez.xyz;

location / {
proxy_pass http://localhost:3001/;
}
}
# listens for requests made via cheeez.xyz and redirects them to
# localhost:3000
server {
listen 80;
listen [::]:80;

server_name cheeez.xyz;

location /{
proxy_pass http://localhost:3000/;
}
}