Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # generate certificate and key with openssl and then mount them
- version: '2.3'
- postgres:
- image: postgres:alpine
- # specify location to the keys explicitly
- command: -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
- environment:
- POSTGRES_DB: mydb
- POSTGRES_USER: user
- POSTGRES_PASSWORD: secret
- # mount outside of the data dir so you don't get errors about the data dir not being empty
- volumes:
- - ./ca/server.crt:/var/lib/postgresql/server.crt
- - ./ca/server.key:/var/lib/postgresql/server.key
Add Comment
Please, Sign In to add comment