add postgres with ssl
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -64,6 +64,8 @@ photoprism/backup/
|
||||
photoprism/config/hub.yml
|
||||
photoprism/serial
|
||||
photoprism/sidecar/
|
||||
postgres/*.pem
|
||||
postgres/data/
|
||||
postgis/PG_VERSION
|
||||
postgis/base/
|
||||
postgis/core
|
||||
|
||||
23
compose.postgres.yaml
Normal file
23
compose.postgres.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
services:
|
||||
postgres:
|
||||
container_name: postgres
|
||||
image: postgres:17.5-alpine3.22
|
||||
user: postgres
|
||||
ports:
|
||||
- 11111:5432
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=postgres
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_DB=postgres
|
||||
volumes:
|
||||
- /opt/postgres/entrypoint.sh:/entrypoint.sh
|
||||
- /opt/postgres/postgresql.conf:/etc/postgresql/postgresql.conf
|
||||
- /opt/postgres/data:/var/lib/postgresql/data
|
||||
- /opt/postgres/cert.pem:/cert.pem
|
||||
- /opt/postgres/key.pem:/key.pem
|
||||
entrypoint: ["/bin/bash", "/entrypoint.sh"]
|
||||
|
||||
command:
|
||||
- postgres
|
||||
- -c
|
||||
- config_file=/etc/postgresql/postgresql.conf
|
||||
@@ -50,3 +50,4 @@ include:
|
||||
- compose.postgis.yaml
|
||||
- compose.timescaledb.yaml
|
||||
- compose.influxdb.yaml
|
||||
- compose.postgres.yaml
|
||||
|
||||
9
postgres/entrypoint.sh
Normal file
9
postgres/entrypoint.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
chmod 0400 /cert.pem
|
||||
chown postgres:postgres /cert.pem
|
||||
|
||||
chmod 0400 /key.pem
|
||||
chown postgres:postgres /key.pem
|
||||
|
||||
exec "$@"
|
||||
4
postgres/postgresql.conf
Normal file
4
postgres/postgresql.conf
Normal file
@@ -0,0 +1,4 @@
|
||||
ssl = on
|
||||
ssl_cert_file = '/cert.pem'
|
||||
ssl_key_file = '/key.pem'
|
||||
listen_addresses = '0.0.0.0'
|
||||
Reference in New Issue
Block a user