Docker Installation Professional and Corporate
This installation is intended for our commercial version of Faraday. For our community version, please check this installation guide
Once you have downloaded our image file from faraday portal you'll need to load it in docker:
$ docker load -i <path to image tar.gz file>
$ docker image ls | grep faraday
This image can be run as a service or as a standalone container. Both run Faraday Server without PostgreSQL. You will note that we have created
/faraday-storage volumes (for mount your license and storage). We have also created environment variables for Faraday configuration.
We will get more in detail of these volumes and environment variables:
Current user's ~/.faraday/doc and ~/.faraday/storage folders are mounted by default. In case you have these folders in a different place, please replace them with proper path at the moment you run Faraday whether as a standalone container or as a service:
[Running Faraday as a standalone container] $ docker run \ .... -v /path/to/my_doc_folder:/faraday-license \ -v /path/to/my_storage_folder:/faraday-storage \ ....
[Running Faraday as a service] $ vim docker-compose.yml version: '3.7' services: ... volumes: - /path/to/my_doc_folder:/faraday-license - /path/to/my_storage_folde:/faraday-storage ...
We will get more in details about this configuration below.
The following variables came with default values so you'll need to customize some or all of them depending on your installation config.
- PGSQL_HOST=220.127.116.11 # PostgreSQL server host. - PGSQL_USER=faraday_postgresql # PostgreSQL user - PGSQL_PASSWD=mypgsqlpassword # PostgreSQL user's password. - PGSQL_DBNAME=faraday # Faraday's database name
Now that we have learn about the volumes and the enviroment variables above, let's run Faraday assuming we want to connect into PostreSQL's address 192.168.20.29 and that we have located Faraday's config folder in its default location: ~/.faraday.
As a standalone container
Run the following command specifying the correct information:
$ docker run \ -v ~/.faraday/doc:/faraday-license \ -v ~/.faraday/storage:/faraday-storage \ -p 5985:5985 \ -e PGSQL_HOST='192.168.20.29' \ -e PGSQL_PASSWD='mypgsqlpassword' \ -e LISTEN_ADDR='0.0.0.0' \ faraday:c_v3.7
To check container, run the following command:
$ docker container ls
As you can see, Faraday Server is running in port 5985.
As a service
1. Initialize a Swarm:
$ docker swarm init
In case you have more than one ip addr configured in your machine you have to specify which one to use.
$ docker swarm init --advertise-addr=192.168.20.29
2. Docker Compose File:
Now, you need to create a docker-compose.yml file. You can use this docker-compose as example:
version: '3.7' services: server: image: faraday:c_v3.7 environment: - LISTEN_ADDR=0.0.0.0 - PGSQL_HOST=192.168.20.29 - PGSQL_USER=faraday_postgresql - PGSQL_PASSWD=/run/secrets/pgsql_passwd - PGSQL_DBNAME=faraday secrets: - pgsql_passwd ports: - 5985:5985 volumes: - ~/.faraday/doc:/faraday-license - ~/.faraday/storage:/faraday-storage deploy: replicas: 1 placement: constraints: [node.role == manager] secrets: pgsql_passwd: external: true
When Faraday runs as a service, PGSQL_PASSWD can be configured with docker secrets (default in docker-compose.yml). The simplest way to create a secret is reading from standard input (you should take care of bash history).
$ printf mypgsqlpassword | docker secret create pgsql_passwd -
Once you have created the secret, edit you docker-compose.yml and set:
$ vim docker-compose.yml version: '3.7' services: ... environment: - PGSQL_PASSWD=/run/secrets/pgsql_passwd ...
For more information about secrets, check docker web page
Once you are done setting up your docker-compile.yml file, let's deploy by running the following command:
$ docker stack deploy -c docker-compose.yml faraday
4. Check service:
To check the service, run the following command:
$ docker service ls $ docker service logs faraday_server
Once Faraday Server is running you'll have to obtain the container's IP address. For this, run:
$ docker inspect $(docker ps -lq) | grep \"IPAddress
This command will throw the following output:
"IPAddress": "172.17.0.2", "IPAddress": "172.17.0.2",
Now you can direct your browser to