Once ASP.NET Core rest service is compiled, below are the steps to setup Linux (Ubuntu) and deploy .net core service code.
Note: My setup pulls published code from S3 bucket on AWS. I provided links to sample code and conf files for your reference in the comments
Here is the bash script to install .NET Core on Ubuntu and setup .net sample rest service.
#!/bin/bash
#!
Install dotnetcore
sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo
apt-key adv --keyserver
hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
sudo
apt-get update -y
sudo
apt-get install dotnet-dev-1.0.1 –y #!Finished installation of dotnetcore
sudo apt
install awscli –y #!
Install aws
cli command tool
sudo
apt-get install unzip –y #! Install unzip library
sudo apt-get install supervisor –y #! Install supervisor service which starts service and monitors
cd
/home/ubuntu/
mkdir code
cd
code/
cd /var/
mkdir dotnetcore
cd dotnetcore/
cd
/home/ubuntu/code/
unzip
publish.zip -d /var/dotnetcore/ #!
Unzip code to var/dotnetcore
folder
#!Run
this manually.
#!This
requires sudo su
permissions...
service supervisor stop #! Start supervisor service
cd /etc/supervisor/conf.d
No comments:
Post a Comment