how to run asp.net on virtual server for $5 per mo
TRANSCRIPT
How to run ASP.NET on virtual server for $5/mo
and why you should not do this
by Yuriy V. Silvestrov
@ysilvestrov
About us
Yuriy V. Silvestrov15+ years record in IT, 10+ years devoted to managing projects. Differrent occupations from Program Manager to CTO and confounder of two startups. At the moment I am working as a Senior Development Manager for Oracle and also one of the co-developers of
Spillikin.
Facebook: fb.com/ysilvestrov
Please visit my website
http://yuriy.silvestrov.comfor more info or contact me at
@ysilvestrov
About lection Based on my own experience
Useful for startups and pet projects
Not the right way, not the best way, but the working one.
@ysilvestrov
@ysilvestrov
Time is counting
⌛ < 30
@ysilvestrov
How many of you
Have tried ASP.NET Core?
Have run ASP.NET on Linux?
Have tried Heroku and/or Dokku?
Are Dokker Experts?
We’ll try to adapt
@ysilvestrov
@ysilvestrov
Content
What’s this all about?◦ The real task
◦ Why ASP.NET
◦ Where to host?
ASP.NET Core◦ Preparation
◦ Containers
◦ Remotely and locally
Pros and Cons
Q&A
@ysilvestrov, @valkovnet
@ysilvestrov
The real task
@ysilvestrov
Why to choose ASP.NET@ysilvestrov
@ysilvestrov
Why not to buy cheap server or host on Azure
Azure
VDS (Win)
AppHarbor
VDS (Linux)
@ysilvestrov
@ysilvestrov
Solution – Digital Ocean@ysilvestrov
@ysilvestrov
ASP.NET Core: preparation
Download latest VS 2015 and install https://www.microsoft.com/net/core#windows
Download latest ASP.NET Core and install https://www.microsoft.com/net/core#windows
Check if everything is working by running tutorial https://docs.asp.net/en/latest/getting-started.html
@ysilvestrov
@ysilvestrov
ASP.NET Core & container: locally
Download and install Docker for Windows https://www.docker.com/products/docker#/windows
Download and install Kitematic right from Docker menu
Install VS tools for Docker https://visualstudiogallery.msdn.microsoft.com/0f5b2caa-ea00-41c8-b8a2-058c7da0b3e4
Create Ubuntu host with Kitematic
Run DockerTasks.ps1 as described in VS tools above
In Kitematic you'll see new container. Open WebPreview in browser and enjoi :)
@ysilvestrov
@ysilvestrov
ASP.NET Core & container: remotely - registration
Register on DigitalOcean. You can use my referral link, if you'd like https://m.do.co/c/61f8c0f9852c
Create a droplet◦ OneClick apps: Dokku
◦ Size: smallest ($5/mo)
◦ Choose region (I personally like Amsterdam)
◦ No additional options (especially IPv6 - there is a bug with it)
◦ Enter the droplet name
◦ Add key (or create new one)
@ysilvestrov
ASP.NET Core & container: remotely - setup
Setup Domain◦ On your DNS provider, add 2 DNS records
your.domain A DropletIP
*.your.domain A DropletIP
open Dokku on http://your.domain◦ Check the key
◦ Change hostname to your.domain
◦ Check "Use virtualhost naming"
◦ Click Finish setup
@ysilvestrov
ASP.NET Core & container: remotely - tools
Install tools◦ Git for Windows
◦ PuTTy
◦ Add your keys to pageant (installed with PuTTy)
◦ Open your.domain in PuTTy to cache the key
@ysilvestrov
ASP.NET Core & container: remotely - deployment
Push your app◦ Open Git Bash shell◦ cd /c/path/to/your/project/bin/Docker/Release◦ copy Dockerfile on this level from [projectname] folder◦ git init◦ git add .◦ git commit -m "First commit"◦ git remote add dokku [email protected]:your-app-
name◦ git push dokku master◦ If everything is OK, you should see "=====>
Application deployed: http:/ /your-app-name.your.domain
◦ Open that URL and enjoi :)
@ysilvestrov
Why the heck the Spillikin API is done using NodeJS?
Limited DB support (apart from SQL Server – PostgreSQL + SQLite)
Too many changes in naming etc. (k => web => dotnet)
Too many changes in interfaces etc.
@ysilvestrov
Questions?
???
@ysilvestrov