This commit is contained in:
Mike McFetridge
2026-07-23 19:38:14 -04:00
parent 72272e4006
commit 84e1ead50c
283 changed files with 0 additions and 206 deletions
+3
View File
@@ -0,0 +1,3 @@
# PostgreSQL credentials
POSTGRES_USER=<< database_user >>
POSTGRES_PASSWORD=<< database_password >>
@@ -0,0 +1,59 @@
services:
<< service_name >>:
image: docker.io/library/postgres:18.3
restart: << restart_policy >>
container_name: << container_name >>
hostname: << container_hostname >>
environment:
- POSTGRES_INITDB_ARGS=<< postgres_initdb_args >>
<%- if postgres_host_auth_method %>
- POSTGRES_HOST_AUTH_METHOD=<< postgres_host_auth_method >>
<%- endif %>
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=<< database_name >>
- TZ=<< container_timezone >>
<%- if network_mode == 'bridge' or network_mode == '' %>
networks:
<< network_name >>:
<%- endif %>
<%- if network_mode == 'bridge' or network_mode == '' %>
ports:
- "<< ports_postgres >>:5432"
<%- endif %>
volumes:
<%- if volume_mode == 'mount' %>
- << volume_mount_path >>:/var/lib/postgresql:rw
<%- else %>
- << service_name >>-data:/var/lib/postgresql
<%- endif %>
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
start_period: 30s
interval: 10s
timeout: 10s
retries: 5
<%- if volume_mode == 'local' %>
volumes:
<< service_name >>-data:
driver: local
<%- elif volume_mode == 'nfs' %>
volumes:
<< service_name >>-data:
driver: local
driver_opts:
type: nfs
o: addr=<< volume_nfs_server >>,<< volume_nfs_options >>
device: ":<< volume_nfs_path >>"
<%- endif %>
<%- if network_mode == 'bridge' or network_mode == '' %>
networks:
<< network_name >>:
<%- if network_external %>
external: true
<%- else %>
driver: bridge
<%- endif %>
<%- endif %>