Enabling SSL for PostgreSQL in Docker by do the config:
database:
image: postgres:alpine
command: -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
environment:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
volumes:
- ./ca/server.crt:/var/lib/postgresql/server.crt
- ./ca/server.key:/var/lib/postgresql/server.key