Service Environment

A folder .s2i is created containing the file environment when running daeploy init. By default, it only contains a single row:


This tells Source-To-Image, which is used internally to convert code into a deployable container image, that is the main file of the service. It just defines an environment variable called APP_FILE, like you would do in linux with:

>>> export  

By setting environment variables this way you can add configuration for your services without having to make changes in the code. To read environment variables in the service code you can use the os module available in standard python:

import os

envvar = os.environ.get("ENV_VAR")

Daeploy Service Configuration

There are some special environment variables that are used for Daeploy service configuration:

    • Number of rows or length of time to keep data in database, cleaned at even intervals. Format <number><unit>. Unit options: "rows", "days", "hours", "minutes" or "seconds".


    • Interval between database cleans. Format <number><unit>. Unit options: "days", "hours", "minutes" or "seconds"