Skip to content

Installing & configuring Docker

Servers require with Docker and docker-compose. You can test if your system has both installed by running:

docker --version
docker-compose --version

If this is not the case, you can follow the guidance on this page to get it up and running easily.

Install Docker

To install Docker on Ubuntu, please follow the official installation guide. The recommended method is using an apt repository.

Uninstall old versions on Ubuntu

If you've installed Docker using Ubuntu's official apt repositories, you must uninstall it and follow the above recommended procedure. These versions tend to be old and cause compatibility issues.

Configure Docker

Once installed, you can configure Docker by following the optional post-installation steps. We recommend you to follow the guide to manage Docker as a non-root user. This way you'll avoid having to run every docker command as root and the developer experience will be more pleasant. You should also configure Docker to start on boot.

Install Compose

We rely heavily on docker-compose to easily create reproducible development and test environments. The easiest way to install Compose on Ubuntu is to download the executable and place it somewhere on the PATH as the official guide suggests. You can also install docker-compose using pip with:

pip install docker-compose

Load the docker images

If you've received the release as a .zip package, please extract the Docker image (a .tar file named *-DockerImage-<version>.tar) somewhere on your machine and run:

docker load -i *-DockerImage-<version>.tar

(change the version as needed)

Container configuration

The container may be configured with a set of environmental variables which can be given when running it with docker or similar commands. The following is a list indicating default values for variables which have a default value.

Server and container behavior

  • SECRET_KEY: It is a mandatory variable, which is used by the server for random numbers generation.
  • DEBUG=False: It may be True or False, please, never use True on production environments.
  • ALLOWED_HOSTS=*: This may be a list separated by commas of hosts from where requests are accepted. Each host may be given by an IP address or a domain name. No wildcards are allowed on host items. By default, it accepts requests from any host.
  • TZ=Europe/Madrid: Configures the time-zone of the server.
  • WORKERS=4: Number of threads to run in the docker container. The minimum number of workers must be ** 2**.
  • ENABLE_SSL=TRUE: ssl enabled, exposing the service with HTTPS in additional port. By default it is set to False. It is important to note that the dasfacebond and the facebondui images come with self-signed certificates. They are just for illustrative purposes and are intended to be used for development and testing and never for production environments. They must be replaced with valid trusted certificates by mounting the certs folder as a volume as shown in the examples below, and saving there, the files server.crt and server.key.
  • FACE_EMBEDDINGS_CIPHER_KEY: If provided, it will cipher the vectors in the database. Please, take into account that ciphering vectors will increase the response times of the product. For more information, please check Vectors encryption section. It must be 16, 24, 32 or 64 bytes long.