Making changes to the environment variables inside the containers
.env
) file inside the Ghostwriter directory. Docker sees this file and reads it when building and bringing containers up. Docker will import and set the environment variables inside the containers. The variables must first be declared in the Docker Compose files (e.g., production.yml
).
Some of the variables influence the Docker builds. The majority of the variables affect configurations of the services like Django and Hasura. Most variables have a service name as their prefix to make it easy to determine which variable affects which services.
For example, the DJANGO_SUPERUSER_PASSWORD
variable has the DJANGO_
prefix to signify it is tied to the Django service and container. It is declared in the YAML files like this:
install
command, Ghostwriter CLI executes manage.py createsuperuser --no-input
to tell Django to create a new superuser. The --no-input
flag tells Django to look at environment variables for username and password input.
DATE_FORMAT
is an alias for DJANGO_DATE_FORMAT
to make it easy for a user to change their desired date format. Docker only uses DJANGO_DATE_FORMAT
. When a user changes DATE_FORMAT
, Ghostwriter CLI also updates DJANGO_DATE_FORMAT
.
environment
key for the container that needs the variable
DJANGO_DATE_FORMAT
again, add the variable like this with env()
: