Skip to content

Docker Installation

Using docker compose:

services:
  foyer:
    image: ghcr.io/arpanrec/foyer:latest
    container_name: foyer
    ports:
      - 3000:3000
    volumes:
      - /path/to/config:/app/config # Make sure your local config directory exists
      - /var/run/docker.sock:/var/run/docker.sock:ro # (optional) For docker integrations
    environment:
      FOYER_ALLOWED_HOSTS: foyer.arpanrec.com # required, may need port. See foyer.arpanrec.com/installation/#foyer_allowed_hosts

Running as non-root

By default, the Foyer container runs as root. Foyer also supports running your container as non-root via the standard PUID and PGID environment variables. When using these variables, make sure that any volumes mounted in to the container have the correct ownership and permissions set.

Using the docker socket directly is not the recommended method of integration and requires either running foyer as root or that the user be part of the docker group

In the docker compose example below, the environment variables $PUID and $PGID are set in a .env file.

services:
  foyer:
    image: ghcr.io/arpanrec/foyer:latest
    container_name: foyer
    ports:
      - 3000:3000
    volumes:
      - /path/to/config:/app/config # Make sure your local config directory exists
      - /var/run/docker.sock:/var/run/docker.sock:ro # (optional) For docker integrations, see alternative methods
    environment:
      FOYER_ALLOWED_HOSTS: foyer.arpanrec.com # required, may need port. See foyer.arpanrec.com/installation/#foyer_allowed_hosts
      PUID: $PUID
      PGID: $PGID

With Docker Run

docker run -p 3000:3000 -e FOYER_ALLOWED_HOSTS=foyer.arpanrec.com -v /path/to/config:/app/config -v /var/run/docker.sock:/var/run/docker.sock ghcr.io/arpanrec/foyer:latest

Custom base path

The published image serves Foyer from /. To serve it under a sub-path such as /foyer (see FOYER_BASE_PATH), build your own image from a clone of this repository with the FOYER_BASE_PATH build argument:

docker build --build-arg FOYER_BASE_PATH=/foyer -t foyer:custom-base-path .

Docker Compose can build it for you:

services:
  foyer:
    build:
      context: /path/to/foyer # your clone of this repository
      args:
        FOYER_BASE_PATH: /foyer
    container_name: foyer
    ports:
      - 3000:3000
    volumes:
      - /path/to/config:/app/config # Make sure your local config directory exists
    environment:
      FOYER_ALLOWED_HOSTS: foyer.arpanrec.com # required, may need port. See foyer.arpanrec.com/installation/#foyer_allowed_hosts

Run it with docker compose up --build --detach; Foyer is then served at http://localhost:3000/foyer. The image keeps the base path it was built with, and its health check uses it too. Do not set FOYER_BASE_PATH as a container environment variable: routing ignores it, and a value that differs from the build breaks the health check.

Using Environment Secrets

You can also include environment variables in your config files to protect sensitive information. Note:

  • Environment variables must start with FOYER_VAR_ or FOYER_FILE_
  • The value of env var FOYER_VAR_XXX will replace {{FOYER_VAR_XXX}} in any config
  • The value of env var FOYER_FILE_XXX must be a file path, the contents of which will be used to replace {{FOYER_FILE_XXX}} in any config