Skip to content

Commit

Permalink
Add implementation for supporting SSL certificate
Browse files Browse the repository at this point in the history
in postgres service.
  • Loading branch information
abdulla-ashurov committed Jun 29, 2023
1 parent 58d87b6 commit 8c4a91a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker/with-external-db/docker-compose-with-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,16 @@ services:
user: postgres
volumes:
- ./pg-init-scripts:/docker-entrypoint-initdb.d
- ./ssl-certificates/root.crt:/var/lib/postgresql/root.crt
- ./ssl-certificates/server.crt:/var/lib/postgresql/server.crt
- ./ssl-certificates/server.key:/var/lib/postgresql/server.key
ports:
- 5432:5432
# Edit the environment variables in postgres.env to change the database name, username, password, etc.
# Postgres setup and configuration is outside the scope of this file.
env_file:
- postgres.env
command: "-c ssl=on -c ssl_ca_file=/var/lib/postgresql/root.crt -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key"
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 10s
Expand Down

0 comments on commit 8c4a91a

Please sign in to comment.