Skip to content

Instantly share code, notes, and snippets.

@malkab
Last active September 15, 2022 10:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malkab/ec1f0fdacf49598f53d3997e13b38157 to your computer and use it in GitHub Desktop.
Save malkab/ec1f0fdacf49598f53d3997e13b38157 to your computer and use it in GitHub Desktop.
Docker Compose for PostgreSQL
version: '3.5'
networks:
sunnsaas:
external: false
name: network_name
attachable: true
volumes:
phd-data-postgis:
external: false
name: phd-data-postgis
configs:
config_a:
file: ./conf/config_a.json
services:
postgis:
image: malkab/postgis:holistic_hornet
container_name: sunnsaas_postgis_v1
# Put here other configs as described at the Docker image documentation
environment:
- PASSWORD=postgres
networks:
- sunnsaas
ports:
- "${MLKC_SUNNSAAS_DB_OUTER_PORT}:5432"
# This tmpfs volume is a workaround to increase the shared memory allowed to be
# used by the container in a SWARM deployment. PG uses this in demanding queries.
# This example increases the default to aprox. 8GB.
tmpfs:
- /tmp:size=8000000000
volumes:
- ./000_localhost_volumes/sunnsaas_postgis:/data
- ../../assets/pg/postgresql.conf:/default_confs/postgresql.conf
- phd-data-postgis:/whatever
- type: tmpfs
target: /dev/shm
configs:
- source: config_a
target: /path/to/mount/config
mode: 644
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment