I'm trying to connect weblate to external rds postgres database. I'm using docker compose file that run weblate container. To this container I add the environment variables to connect to rds postgres. The weblate container doesn't connect to rds postgres and give me this error:
psql: error: connection to server at "XXXX.rds.amazonaws.com", port 5432 failed: FATAL: password authentication failed for user "postgres"
but if I try to connect to rds postgres from inside the weblate container via cli, it works.
docker compose file:
version: '3'
services:
weblate:
image: weblate/weblate
tmpfs:
- /app/cache
volumes:
- weblate-data:/app/data
env_file:
- ./environment
restart: always
ports:
- 80:8080
environment:
POSTGRES_PASSWORD: XXXX
POSTGRES_USER: myuser
POSTGRES_DATABASE: mydb
POSTGRES_HOST: XXX.rds.amazonaws.com
POSTGRES_PORT: 5432
I found the problem. The problem was the char $ inside password.
Maybe the library used to connect to postgres has a bug or, simple, not allowed $ in password string. When I removed that char it works.