Docker image for running ServiceStack on docker container using mono
#Create Ubuntu Virtual Machine On Azure
Login to Microsoft Azure and click on Add
button in Virtual Machines
pane
In new opened pane type Ubuntu Server
in filter string then select Ubuntu Server 14.04 LTS
and click button Create
To see the rest of the creation process follow the link Create Ubuntu Virtual Machine On Azure
#Run Docker Image
Login to your virtual machine using ssh or putty.
##Install Docker
To install docker you need to run following command:
curl -fsSL https://get.docker.com/ | sh
##Run Docker
Place your application into /var/www/hello-app
and then run docker image
sudo docker run -d -p 80:80 \
-e USERSITE=www.yourdomain.com \
-e USERLOCATION=/var/www/hello-app \
-v /var/www:/var/www \
servicestack/hyperfastcgi
Where
USERSITE
- Domain name of the site you will run, for examplewww.yourdomain.com
USERLOCATION
- Directory where applications is located
After executing the command you will get container ID.
To stop docker container you can run:
sudo docker stop <container ID>
sudo apt-get install git
git clone https://github.com/ServiceStackApps/mono-docker-config
cd mono-docker-config
sudo docker build .
Now you have got docker image which is ready to run. Remember ID of docker image. Place your application into /var/www/hello-app
and run the command
sudo docker run -d -p 80:80 \
-e USERSITE=www.yourdomain.com \
-e USERLOCATION=/var/www/hello-app \
-v /var/www:/var/www \
92627a6cbee6
Where
USERSITE
- Domain name of the site you will run, for examplewww.yourdomain.com
USERLOCATION
- Directory where applications is located92627a6cbee6
- Docker image ID created on the previous step