Service running PostgreSQL
docker compose up -d postgres
Name | Default |
---|---|
POSTGRESQL_VERSION | 15.5.0 |
POSTGRESQL_CONTAINER_NAME | |
POSTGRESQL_USER | root |
POSTGRESQL_PASSWORD | root |
POSTGRESQL_DB | postgres |
POSTGRESQL_ENABLE_TLS | no |
POSTGRESQL_RESTART_POLICY | no |
- Set
POSTGRESQL_RESTART_POLICY
toyes
at the.env
file
POSTGRESQL_RESTART_POLICY=yes
- Go to the certs volume of the postgres service
cd ./volumes/postgres/certs
- Generate certificates
openssl req -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out postgres.crt -keyout postgres.key
- Change de owner of these files
sudo chown 1001 postgres.*
- Finally, you can start the service.