How to run d app as service ?

aberba karabutaworld at gmail.com
Tue Feb 20 08:22:41 UTC 2018


On Monday, 19 February 2018 at 12:29:12 UTC, Jayam wrote:
> In production server, we need to run Dlang app as service.

The Heroku tour Seb wrote about above is one easy way to host a 
serverside app (if that's what you're looking for).  However, 
serverside apps need someone sort of database so you may use one 
of Heroku addons for a third party mysql hosting.


Recently I've found a much convenient and future prof approach 
with Google's app engine. When you have their CLI client 
installed, all that is left is a config yaml file (to set it as a 
custom runtime)  and your docker file.

app.yaml
---------
env: flex
runtime: custom


Then the docker file will configure your app into a docker image. 
I've written a sample docker Vibe.d app in my Github repo at 
https://github.com/aberba/docker-vibed-demo.

With your app.yaml file placed in your docker project root,  all 
you now do is run the command:

gcloud app deploy


Google Cloud has mysql and Postgresql support. Plus tone of other 
services when u need them. Its much cheaper than Heroku for 
starters. Cheaper than AWS with their per minute pay-what-you-use 
pricing policy.


Anyways, if you know enough docker orchestration, you can roll 
out your own docker cluster. A lot of options are available with 
Docker.


More information about the Digitalmars-d mailing list