File tree 3 files changed +43
-0
lines changed
3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1
1
. \#
2
2
* \# * \#
3
+ .DS_Store
4
+ run_postgres_ssl /* .pem
5
+ run_postgres_ssl /* .crt
6
+ run_postgres_ssl /* .key
7
+ run_postgres_ssl /* .req
Original file line number Diff line number Diff line change
1
+ version : ' 2'
2
+
3
+ services :
4
+ postgres :
5
+ container_name : postgres
6
+ ports :
7
+ - " 5433:5432"
8
+ image : ' postgres:12-alpine'
9
+ environment :
10
+ - POSTGRES_HOST_AUTH_METHOD=trust
11
+ - POSTGRES_PASSWORD=password
12
+ volumes :
13
+ - ' $PWD/server.crt:/var/lib/postgresql/server.crt:ro'
14
+ - ' $PWD/server.key:/var/lib/postgresql/server.key:ro'
15
+ - ' $PWD/pg_hba.conf:/var/lib/postgresql/pg_hba.conf'
16
+ command : postgres -c ssl=on -c ssl_cert_file=/var/lib/postgresql/server.crt -c ssl_key_file=/var/lib/postgresql/server.key
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -euo pipefail
4
+
5
+ openssl req -new -text -passout pass:abcd -subj /CN=localhost -out server.req -keyout privkey.pem
6
+
7
+ openssl rsa -in privkey.pem -passin pass:abcd -out server.key
8
+
9
+ openssl req -x509 -in server.req -text -key server.key -out server.crt
10
+
11
+ chmod 600 server.key
12
+
13
+ test $( uname -s) = Linux && chown 70 server.key
14
+
15
+ echo ' --------------------------------------------------'
16
+ echo ' To Connect, Run:'
17
+ echo ' '
18
+ echo ' psql -p 5433 "sslmode=verify-full host=localhost dbname=postgres user=postgres"'
19
+ echo ' '
20
+ echo ' --------------------------------------------------'
21
+
22
+ PWD=$( pwd) docker-compose up --force-recreate
You can’t perform that action at this time.
0 commit comments