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.

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.
PRIMARY_PROCESS   Set to initpgsql.

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.

Container Environment Variables

FME Server Web Services Container

Environment Variable

Default Value

Description

EXTERNALHOSTNAME localhost The host name that users will use to connect to this FME Server. This is commonly the hostname or IP address of the physical machine on which the Docker deployment is running, or the external endpoint of the load balancer. This variable is used for Topic Monitoring. If you do not need to use Topic Monitoring, leave as localhost.
EXTERNALPORT 80 The port used to connect to the FME Server Web User Interface. This should be the port exposed on the host or load balancer that users will use to connect.
FMESERVERHOSTNAME fmeservercore The service name or host name of the FME Server Core container.
WEBSERVERHOSTNAME fmeserverweb The service name or host name of the FME Server Web Services container.
WEBPROTOCOL https The protocol FME Server uses. Can be either http or https.
WEBSOCKETHOSTNAME fmeserverwebsocket The service name or host name of the WebSocket server container.
LOGPREFIX The host name of the container The prefix to use on the log files created by this container.

FME Engine Container

Environment Variable

Default Value

Description

EXTERNALHOSTNAME localhost The host name that users will use to connect to this FME Server. This is commonly the hostname or IP address of the physical machine on which the Docker deployment is running. This is used for the data download results URL that is returned after running a job in the Data Download Service. If you don’t use the Data Download service, leave as localhost.
EXTERNALPORT 443 Port used to connect to FME Server.
FMESERVERHOSTNAME fmeservercore The service name or host name of the FME Server Core container.
PGSQLHOSTNAME fmeserverdb The service name or host name of the FME Server PostgreSQL database. If you want to use a different database type, see Changing the Database Connection, above.
PGSQLPORT 5432 The port for the FME Server PostgreSQL database. If you want to use a different database type, see Changing the Database Connection, above.
WEBPROTOCOL https The protocol FME Server uses. Can be either http or https.
LOGPREFIX The host name of the container The prefix to use on the log files created by this container.
FME_INSTANCE_NAME The host name of the container The name of the engine that appears on the Engines & Licensing page.
NODENAME The host name of the container The host name of the engine that the Core container uses to communicate with this engine.

FME Server Core Container

Environment Variable

Default Value

Description

FMESERVERHOSTNAME fmeservercore The service name or host name of the FME Server Core container.
PGSQLHOSTNAME fmeserverdb The service name or host name of the FME Server PostgreSQL database. To use a different database type, see Changing the Database Connection, above.
PGSQLPORT 5432 The port for the FME Server PostgreSQL database. To use a different database type, see Changing the Database Connection, above.
WEBSERVERHOSTNAME fmeserverweb The service name or host name of the FME Server Web Services container.
REDISHOSTS fmeserverqueue The service name or host name of the Redis queue.
REDISPORT 6379 The port for the Redis queue.
PORTPOOL  

This setting is required only if FME Engines that are not running in Docker are connecting to this FME Server Core. If engines are connecting from outside the docker network, perform the following:

  1. Open additional ports in the Compose file for the engines to connect.
  2. Set this PORTPOOL variable to a port range, such as PORTPOOL=9000-9200.
  3. Map the specified ports to the physical host in the Compose file under the ports section. For example: 9000-9200:9000-9200.
MAX_TRANSACTION_RESULT_SUCCESSES   Specifies the number of successful translations until an engine process should be restarted.
MAX_TRANSACTION_RESULT_FAILURES   Specifies the number of failed translations until an engine process should be restarted.
PRIMARY_PROCESS core Defines the purpose of this container. Valid values are core, websocket, or initpgsql. Setting to websocket starts only the websocket process. Setting to initpgsql runs the database initialization scripts against the configured database. For more information, see Initializing the PostgreSQL Database, above.

NGINX Container

Environment Variable

Default Value

Description

WEBPROTOCOL https The protocol FME Server uses. Can be either http or https.
EXTERNALHOSTNAME localhost The host name that users will use to connect to this FME Server. This is commonly the hostname or IP address of the physical machine on which the Docker deployment is running. This variable is used for Topic Monitoring. If you do not need to use Topic Monitoring, leave as localhost.
EXTERNALPORT 443 The port used to connect to FME Server.
NGINX_WORKER_PROCESSES 1 Number of NGINX workers to start.