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.

Application

Creating Application

Creating a new project is as simple as choosing its name in your application configs(.qovery.yml):

application:
name: myApp
project: 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 Dockerfile and .qovery.yml files are mandatory to run your Application with Qovery.

Dockerfile

Qovery runs your application within the Container technology. To build and run your application, you need to provide a valid Dockerfile.

Valid NodeJS Dockerfile
FROM node:13-alpine
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . .
RUN npm install
EXPOSE 3000
CMD 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: myApp
project: myProject
cpu: 1
dockerfile: 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: myApp
project: myProject
cpu: 1

Accepted values are Integer and Millis CPU.

2 CPUs requested
application:
name: myApp
project: myProject
cpu: 2
1/4 of CPU requested
application:
name: myApp
project: myProject
cpu: 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: myApp
project: myProject
ram: 256MB

Accepted values are MB (mega bytes) and GB (giga bytes)

1 GB requested
application:
name: myApp
project: myProject
ram: 1GB

Publicly accessible

To publicly expose your application you need to add the following lines into your .qovery.yml

publicly expose my application and route the traffic into it
application:
name: myApp
project: myProject
publicly_accessible: true
routers:
- name: my-router
routes:
- application_name: myApp
paths:
- /

See what is a router to go further.

You also need to add the EXPOSE {port} instruction into your Dockerfile

Expose
...
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:

Change the start timeout to 5 minutes
application:
name: myApp
project: myProject
start_timeout: 600s

or

Change the start timeout to 5 minutes
application:
name: myApp
project: myProject
start_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.
Declare dependencies
application:
name: frontend
project: myProject
depends_on:
- user-api
billing-api

The depends_on property, guarantee that your app will never start before others that it depends on.