Guest User

Untitled

a guest
Aug 14th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. # generate certificate and key with openssl and then mount them
  2. version: '2.3'
  3. postgres:
  4. image: postgres:alpine
  5. # specify location to the keys explicitly
  6. command: -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
  7. environment:
  8. POSTGRES_DB: mydb
  9. POSTGRES_USER: user
  10. POSTGRES_PASSWORD: secret
  11. # mount outside of the data dir so you don't get errors about the data dir not being empty
  12. volumes:
  13. - ./ca/server.crt:/var/lib/postgresql/server.crt
  14. - ./ca/server.key:/var/lib/postgresql/server.key
Add Comment
Please, Sign In to add comment