OpenKnowledgeMaps / Headstart

A framework for creating web-based knowledge maps
https://openknowledgemaps.org/
MIT License
197 stars 42 forks source link

.env default file hidden under server/workers/flavorconfigs/example.env #659

Open frafra opened 2 years ago

frafra commented 2 years ago

Hi, there is a docker-compose.yml which use some env variables, but there is no example of list of these variables. It would be useful to have an .env file (or an example) listing these variables with some defaults, as the current setup cannot be executed otherwise.

This is what I have done with version 7:

$ grep -Po '(?<=\${)[^}]*(?=})' docker-compose.yml | sort -u | xargs -I% echo %=
API_PORT=
COMPOSE_PROJECT_NAME=
POSTGRES_HOST=
POSTGRES_HOSTNAME=
POSTGRES_PASSWORD=
POSTGRES_PORT=
POSTGRES_USER=
REDIS_DB=
REDIS_HOST=
REDIS_PASSWORD=
REDIS_PORT=
SERVICE_VERSION=

Here is a possible example:

API_PORT=8000
COMPOSE_PROJECT_NAME=headstart
POSTGRES_HOST=postgres
POSTGRES_HOSTNAME=db
POSTGRES_PASSWORD=changeme
POSTGRES_PORT=5432
POSTGRES_USER=postgres
REDIS_DB=redis
REDIS_HOST=redis
REDIS_PASSWORD=changeme
REDIS_PORT=6379
SERVICE_VERSION=7

Some of these variables could be hardcoded:

frafra commented 2 years ago

It would be also nice to have a comment within such file explaining what a variable does. In master there are variables that are not trivial to figure how what they do or how they should be set.

frafra commented 2 years ago

Ok, I guess that the example is stored here: https://github.com/OpenKnowledgeMaps/Headstart/blob/8dd82a9854a6d915e80a87a3ecbd2c13775dccf3/server/workers/flavorconfigs/example.env.

As docker compose expects .env to be in the same directory of docker-compose.yml by default, I would suggest moving example.env file closer to where it is expected to be found.