Describe the issue
When using custom configuration for Postgres (database, user and password), Weblate container will stop because it will not be able to connect to database.
For example if I use the following values in ./environment, then Weblate container will never start properly:
POSTGRES_DATABASE=weblate
POSTGRES_USER=wluser
POSTGRES_PASSWORD=wlpass
The reason is that in Postgres 16 the default environment variable for declaring a database is POSTGRES_DB and not POSTGRES_DATABASE.
According to Postgres documentation:
POSTGRES_DB
This optional environment variable can be used to define a different name for the default database that is created when the image is first started. If it is not specified, then the value of POSTGRES_USER will be used.
The default ./environment values will work because you are using the same value for database, username and password.
I already tried
Steps to reproduce the behavior
- Clone the weblate-docker repo.
- Edit
./environment and use different values for POSTGRES_DATABASE, POSTGRES_USER and POSTGRES_PASSWORD.
- Execute
docker compose up.
- You will see Weblate will never start because it can't establish a connection with database due to unknown database.
Expected behavior
Weblate container must start properly.
Screenshots
As you can see Postgress creates database wluser instead of weblate because POSTGRES_DB is not used.

Exception traceback
No response
Additional context
No response
Describe the issue
When using custom configuration for Postgres (database, user and password), Weblate container will stop because it will not be able to connect to database.
For example if I use the following values in
./environment, then Weblate container will never start properly:The reason is that in Postgres 16 the default environment variable for declaring a database is
POSTGRES_DBand notPOSTGRES_DATABASE.According to Postgres documentation:
The default
./environmentvalues will work because you are using the same value for database, username and password.I already tried
Steps to reproduce the behavior
./environmentand use different values forPOSTGRES_DATABASE,POSTGRES_USERandPOSTGRES_PASSWORD.docker compose up.Expected behavior
Weblate container must start properly.
Screenshots
As you can see Postgress creates database
wluserinstead ofweblatebecausePOSTGRES_DBis not used.Exception traceback
No response
Additional context
No response