Introduction
Adonis is a fully featured web framework for Node.js. In this article, we are going to deploy a freshly created AdonisJS application to Valyent.Prerequisites
- a UNIX-like system (see WSL if you are using Windows), in order to use the Valyent CLI
- a Valyent account, with a registered payment method (you can sign up here)
- NodeJS and NPM installed on your machine
Installing the CLI
Authenticating
Initializing the project
In the first place, we are going to set up a new AdonisJS project. You can refer to the official documentation.web
project structure.
Now, we can initialize the valyent.toml
configuration file, that allows to link the local codebase, to a Valyent application :
Adding the Dockerfile
Let’s add a Dockerfile so that Valyent can build a Docker image for your application.Setting environment variables
Option 1
We can set environment variables using thevalyent env set
command :
Option 2
We are also able to load environment variables from a.env
file :
.env.prod
file to your .gitignore
file.