IronFunctions Runtime Options

March 21, 2017 ยท View on GitHub

Configuration

When starting IronFunctions, you can pass in the following configuration variables as environment variables. Use -e VAR_NAME=VALUE in docker run. For example:

docker run -e VAR_NAME=VALUE ...
Env VariablesDescriptionDefault values
DB_URLThe database URL to use in URL format. See Databases for more information.bolt:///app/data/bolt.db
MQ_URLThe message queue to use in URL format. See Message Queues for more information.bolt:///app/data/worker_mq.db
API_URLThe primary IronFunctions API URL to that this instance will talk to. In a production environment, this would be your load balancer URL.N/A
PORTSets the port to run on8080
LOG_LEVELSet to DEBUG to enable debuggingINFO
DOCKER_HOSTDocker remote API URL/var/run/docker.sock:/var/run/docker.sock
DOCKER_API_VERSIONDocker remote API version1.24
DOCKER_TLS_VERIFYSet this option to enable/disable Docker remote API over TLS/SSL.0
DOCKER_CERT_PATHSet this option to specify where CA cert placeholder~/.docker/cert.pem

Starting without Docker in Docker

The default way to run IronFunctions, as it is in the Quickstart guide, is to use docker-in-docker (dind). There are a couple reasons why we did it this way:

  • It's clean. Once the container exits, there is nothing left behind including all the function images.
  • You can set resource restrictions for the entire IronFunctions instance. For instance, you can set --memory on the docker run command to set the max memory for the IronFunctions instance AND all of the functions it's running.

There are some reasons you may not want to use dind, such as using the image cache during testing or you're running Windows.

Mount the Host Docker

One way is to mount the host Docker. Everything is essentially the same except you add a -v flag:

docker run --rm --name functions -it -v /var/run/docker.sock:/var/run/docker.sock -v $PWD/data:/app/data -p 8080:8080 iron/functions

Run outside Docker

You can of course just run the binary directly, you'll just have to change how you set the environment variables above.

See contributing doc for information on how to build and run.