Open andybeak opened 5 years ago
I am also looking into this. We need to persist data during development or, is it suggested that we should install this in a "staging" env then the local dev will point into that?
@jsdecena I took another look at this today.
Mounting the volumes that are in the docker file (https://github.com/NREL/api-umbrella/blob/master/docker/Dockerfile) with docker-compose seems to yield good results.
So far I've only tested that my admin user and an API user I create are persisted, but I'm hoping the backends will be too. I've confirmed that stopping the container and rebuilding the image from scratch keeps these settings.
I'm not going to bother trying to persist the frontend site because I use something else to document my API.
version: '3'
services:
umbrella:
image: nrel/api-umbrella
restart: always
container_name: api-umbrella
ports:
- "80:80"
- "443:443"
volumes:
- ./db:/opt/api-umbrella/var/db
- ./log:/opt/api-umbrella/var/log
networks:
default:
external:
name: client_api
I've also tested this with named volumes and NFS volumes and works well.
I'm using docker-compose with the config as below.
There does not seem to be a way to persist the configuration of the container. When I use the volume mounting that the documentation gives at https://apiumbrella.io/install/ the mount is empty.
If I run bash on the container I can see that there is no /etc/api-umbrella directory, but there is an /opt/api-umbrella//etc directory.
Is this perhaps a mistake in the documentation? How is it possible to persist configuration like API backends and users between instances of the container?