All the configuration and application data is stored on a temporary filesystem in Docker container, so all your changes to settings and data (users and apps) will be lost after container stops. There are a couple of ways to address that (please see the sections below).
Preserving state across container restarts
To introduce state to the above setup, Docker bind mounts or Docker volumes can be used for either configuration or application data, or both; Identifo also allows for using AWS S3 a persistent configuration storage.
Preserving configuration changes
The simplest way to introduce state is to create a folder on the host machine, place a config file there and bind mount it to the Docker container. You can download the default config file from the Identifo repository and use it as is:
mkdirdata#create a directory for Identifo data curl-odata/config.yamlhttps://raw.githubusercontent.com/MadAppGang/identifo/master/cmd/config-boltdb.yaml
Now run the image specifying a mount:
This way, all the updates made to configuration will be reflected in the data/config.yaml file on your host machine.
--config flag also accepts S3 prefixes as a valid config file location:
Preserving users and applications
Default Identifo configuration uses BoltDB as a persistent storage for application data, with database file located under /data folder. Similar to the example with preserving configuration changes, to make application data survive container restarts, you can either mount the /data folder from the host filesystem, or create a Docker volume.
Use the following command to create and use a Docker-managed volume called identifo-data:
To get the details about this volume: docker volume inspect identifo-data.
To delete the volume: docker volume rm identifo-data.
Another option is to mount a host's folder when running the Docker image:
This command will use ./data directory on your host filesystem as a /data folder in Docker container filesystem. Just ensure the directory exists on your host machine, Docker will not create it for you.