Working with FME Server Container Environment Variables

To perform additional configuration of an FME Server deployment with Docker Compose, define an environment variable section under the relevant container service. Each service has a different set of environment variables that can be defined.

FME Server Web Services Container

FME Engine Container

FME Server Core Container

NGINX Container

Changing the Database Connection

Note: To configure FME Server to connect to a Microsoft SQL Server or an Oracle database, contact Safe Support.

Initializing the PostgreSQL Database

When a new stack is launched, a mode of the core container populates an empty PostgreSQL database with the FME Server database schema before starting FME Server. If you want to use an existing PostgreSQL database for your FME Server, you must configure an initialization container using the following environment variables.

For example, the following command populates the schema in an existing PostgreSQL database running on host my-psgql-hostname, and then exits.

docker run -e PGSQLHOSTNAME=my-pgsql-hostname -e PGSQLPORT=5432 -e PGSQLADMINUSER=postgres -e PGSQLADMINPASSWORD=postgres -e PRIMARY_PROCESS=initpgsql safesoftware/fmeserver-core:2018-latest

 

Environment Variable

Default Value

Description

PGSQLHOSTNAME fmeserverdb

The host name of the PostgreSQL database that is to be initialized.

PGSQLPORT 5432 The port to connect to the PostgreSQL database.
PGSQLADMINUSER postgres A user that exists on the PostgreSQL database that has permissions to create a database.
PGSQLADMINPASSWORD   The password for the PGSQLADMINUSER.
PGSQLADMINDATABASE Same value as PGSQLADMINUSER Set this to the database to which to connect initially as the PGSQLADMINUSER to initialize the database schema on the fmeserverdbinit service.
PGSQLUSERNAME fmeserver The user to create as part of the FME Server schema that FME Server will use to connect to the database.
PRIMARY_PROCESS   Set to initpgsql.
AZUREPOSTGRESQL false Set to true on the fmeserverdbinit service in the Docker Compose file when using an Azure database for PostgreSQL to ensure the connection string is formatted correctly.

Running the Containers as a Different User

By default, the FME Server containers run as a user named fmeserver in group fmeserver, with UID and GID 1363. You may want the UID and GID of the user in the container to match a user defined on the host machine. For example, you may want to use a host bind mount for the FME Server System Share volume instead of using Docker volumes. If mounting a host directory into the container, it is optimal if the permissions in that folder match a real user on the host.

To match the user and group running a container with a user defined on the host machine, pass in variables FMESERVER_UID and FMESERVER_GID, set to the UID and GID of the user and group ID you want to use, respectively. Additionally, you must run the containers as the root user so that the container init can set the right permissions on the files. This is done in a Docker run command with the --user=0 flag, and in Compose with the attribute user: 0 to run as root.

Running Containers in the Local Time Zone

By default, FME Server containers run in Coordinated Universal Time (UTC). To adjust to the local time zone of the container hosts, mount time zone files to the fmeserverweb, fmeservercore, fmeserverqueue, and fmeserverengine containers, as follows:

volumes:

- "/etc/timezone:/etc/timezone:ro"

- "/etc/localtime:/etc/localtime:ro"

Alternatively, set the TZ environment variable for each container, as follows:

TZ=<timezone>

where <timezone> is a valid country code. For a list of country codes, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.