Skip to content

Commit

Permalink
test: use directory outside of /var/lib/postgresql
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Sep 30, 2024
1 parent bcc444c commit c544239
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions database/testdata/owncerts.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash
set -e

chmod 600 /var/lib/postgresql/*.key
chmod 644 /var/lib/postgresql/*.crt
chown -R postgres:postgres /opt/moov/

chown root:root /var/lib/postgresql/*.key
chown root:root /var/lib/postgresql/*.crt
chmod 600 /opt/moov/certs/*.key
chmod 644 /opt/moov/certs/*.crt

chown postgres:postgres /opt/moov/certs/*.key
chown postgres:postgres /opt/moov/certs/*.crt

ls -l /var/lib/postgresql/
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
restart: always
ports:
- "5432:5432"
command: -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key -c ssl_ca_file=/var/lib/postgresql/root.crt
command: -c ssl=on -c ssl_cert_file=/opt/moov/certs/server.crt -c ssl_key_file=/opt/moov/certs/server.key -c ssl_ca_file=/opt/moov/certs/root.crt
healthcheck:
test: ["CMD-SHELL", "pg_isready -U moov"]
interval: 5s
Expand All @@ -46,9 +46,9 @@ services:
networks:
- intranet
volumes:
- ./testcerts/root.crt:/var/lib/postgresql/root.crt
- ./testcerts/server.crt:/var/lib/postgresql/server.crt
- ./testcerts/server.key:/var/lib/postgresql/server.key
- ./testcerts/root.crt:/opt/moov/certs/root.crt
- ./testcerts/server.crt:/opt/moov/certs/server.crt
- ./testcerts/server.key:/opt/moov/certs/server.key
- ./database/testdata/owncerts.sh:/docker-entrypoint-initdb.d/owncerts.sh

networks:
Expand Down

0 comments on commit c544239

Please sign in to comment.