Applications
An application is part of a project and is a container unit. Multiple applications can be part of the same project, be connected to a set of dependencies (databases and other services), and can communicate with other applications within the same project.
To learn more about Application, read a high-level description of what Application concept means at Qovery.
Creating Application
Creating a new project is as simple as choosing its name in your application configs(.qovery.yml
):
application:name: myAppproject: myProject
Above snippet creates an application myApp
within the project myProject
.
Renaming Application
To give to your application a new name, just type qovery application rename $NEW_NAME
, where $NEW_NAME
is a placeholder for the new name you want to use.
After it's done, you need to update your .qovery.yml
configuration file to match your new application name.
configuration
- The
.qovery.yml
file is mandatory to run your Application with Qovery. - The
Dockerfile
file is non-mandatory if your application is written in Ruby, Java, Node.JS, Python, Golang or PHP. More will be added. Suggest us to support a language here. If your language is not in the supported list, then you need to provide aDockerfile
.
Application build
Option 1: Buildpacks
To simplify application build for the developer, Qovery supports Buildpacks out of the box. Buildpacks determine the build process for an app, and which assets and runtimes should be made available to your code at runtime. If your complex apps are running multiple languages, you can also use multiple buildpacks within a single app.
Meaning, as a developer, you don't need to write a Dockerfile
to build and run your app. Qovery Buildpacks takes care of everything for you.
Supported languages
language | version |
---|---|
Ruby | any |
Java | any |
Node.JS | any |
Python | any |
Javascript | any |
Typescript | any |
Python | any |
Golang | any |
PHP | any |
You don't find a cool language? Suggest us to support it
Option 2: Dockerfile
Qovery runs your application within the Container technology. To build and run your application, you need to provide a valid Dockerfile.
FROM node:13-alpineRUN mkdir -p /usr/src/appWORKDIR /usr/src/appCOPY . .RUN npm installEXPOSE 3000CMD node ./bin/www
To validate it you can run qovery run
- Note: you need to have Docker running on your computer.
Custom Dockerfile location
To specify the location of your Dockerfile, use dockerfile
field in your .qovery.yml
.
application:name: myAppproject: myProjectcpu: 1dockerfile: my/folder/Dockerfile
Configuration from above will make Qovery look for the Dockerfile in my/folder/Dockerfile
path of your repository.
.qovery.yml
CPU
To configure the number of CPUs that your app needs, you only need to add the cpu
option into the .qovery.yml
application:name: myAppproject: myProjectcpu: 1
Accepted values are Integer and Millis CPU.
application:name: myAppproject: myProjectcpu: 2
application:name: myAppproject: myProjectcpu: 250m
RAM
To configure the number of CPUs that your app needs, you only need to add the ram
option into the .qovery.yml
application:name: myAppproject: myProjectram: 256MB
Accepted values are MB (mega bytes) and GB (giga bytes)
application:name: myAppproject: myProjectram: 1GB
Publicly accessible
To publicly expose your application you need to add the following lines into your .qovery.yml
application:name: myAppproject: myProjectpublicly_accessible: trueport: 8080routers:- name: my-routerroutes:- application_name: myApppaths:- /
See what is a router to go further.
You also need to indicate on which port your application is running.
Option 1
Add port
property in your .qovery.yml
as above.
Option 2
Add the EXPOSE {port}
instruction into your Dockerfile
...EXPOSE 3000...
Your app is now publicly accessible through the auto generated endpoint.
Long startup time
Sometimes your application can take some time to start. E.g., when your app is performing database migration. By default, Qovery waits for 15 seconds to check if your app is running correctly. If it's not the case, your environment is rolled-back to the previous working version.
To prevent this, you can change the startup time:
application:name: myAppproject: myProjectstart_timeout: 600s
or
application:name: myAppproject: myProjectstart_timeout: 5m
Seconds (s) and minutes (m) are accepted units.
Define start order
Qovery gives you the power to have multiple apps within one environment. Sometimes it's necessary to one or multiple apps before others.
By using depends_on
property you can declare a list of apps your app is depending on.
Let's take as example 3 apps:
- billing-api
- user-api
- frontend
Where:
- frontend depends on user-api and billing-api.
application:name: frontendproject: myProjectdepends_on:- user-apibilling-api
The depends_on
property, guarantee that your app will never start before others that it depends on.