Open
Description
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:
- SERVICE_VERSION should be set to the current version, as the compose file is stored together with the code
- hostnames and hosts can be set to their default value (the container name), but I see no reason to change or specify them
- ports could be set to the service default (again, no reason to change them when not using the host network directly)
Metadata
Metadata
Assignees
Labels
No labels