mirror of
https://github.com/ChristianLempa/boilerplates.git
synced 2024-12-25 16:39:01 +01:00
89dd1f5a08
There is little reason not to use PostgreSQL data checksums [1] and they can greatly help to ensure data integrity. [1] https://www.postgresql.org/docs/current/checksums.html
40 lines
1001 B
YAML
40 lines
1001 B
YAML
---
|
|
version: "3.8"
|
|
|
|
services:
|
|
postgres:
|
|
image: docker.io/library/postgres:16.2
|
|
environment:
|
|
- POSTGRES_INITDB_ARGS=${POSTGRES_INITDB_ARGS---data-checksums}
|
|
- POSTGRES_USER=${POSTGRES_USER}
|
|
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password
|
|
# (Optional) when creating a new database
|
|
# - POSTGRES_DB=${POSTGRES_DB}
|
|
ports:
|
|
- 5432:5432
|
|
# (Optional) when using custom network, see also
|
|
# https://docs.docker.com/compose/compose-file/compose-file-v3/#networks
|
|
#
|
|
# networks:
|
|
# - yournetwork
|
|
secrets:
|
|
- postgres_password
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
restart: unless-stopped
|
|
|
|
# (Optional) when using custom network, see also
|
|
# https://docs.docker.com/compose/compose-file/compose-file-v3/#network-configuration-reference
|
|
#
|
|
# networks:
|
|
# yournetwork:
|
|
# external: true
|
|
|
|
secrets:
|
|
postgres_password:
|
|
file: secret.postgres_password.txt
|
|
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|