forked from Islandora-Devops/isle-dc
-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.postgresql.yml
41 lines (40 loc) · 1.93 KB
/
docker-compose.postgresql.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
version: "3.7"
networks:
default:
internal: true
volumes:
postgresql-data:
services:
# This exists side by side with the 'mariadb' service. This is because
# Matomo doesn't support PostgreSQL so if we adopt it we still need to have a
# MySQL as well.
#
# Additionally the defaults need to change on services which use PostgreSQL.
# For those services there is docker-compose.SERVICE.postgresql.yml files which
# are included when the respective 'SERVICENAME_DATABASE_SERVICE' variable is set
# to 'postgresql'.
postgresql:
image: ${REPOSITORY:-islandora}/postgresql:${TAG:-latest}
volumes:
- postgresql-data:/var/lib/postgresql/data
# Allows for access to the database through traefik to support using Drush locally.
# This should not be used in production.
#
# Since this is not http, but tcp traffic it does does not understand the concept of a "host".
# so we must dedicate a port to it in traefik, and direct all traffic to this router: HostSNI(`*`).
labels:
- traefik.enable=true
- traefik.tcp.services.${COMPOSE_PROJECT_NAME-isle-dc}-postgresql.loadbalancer.server.port=5432
- traefik.tcp.routers.${COMPOSE_PROJECT_NAME-isle-dc}-postgresql_tcp.service=${COMPOSE_PROJECT_NAME-isle-dc}-postgresql
- traefik.tcp.routers.${COMPOSE_PROJECT_NAME-isle-dc}-postgresql_tcp.entrypoints=postgresql
- traefik.tcp.routers.${COMPOSE_PROJECT_NAME-isle-dc}-postgresql_tcp.rule=HostSNI(`*`)
networks:
default:
# Allow drupal to access the database with it's edge name to reference
# this service in addition to `database`. This allows us to use the edge
# name in settings.php so Drush on the host machine can be used in the
# codebase folder.
aliases:
- postgresql-${COMPOSE_PROJECT_NAME-isle-dc}.${DRUPAL_SITE_HOST-traefik.me}
- postgresql-${COMPOSE_PROJECT_NAME-isle-dc}-${DRUPAL_SITE_HOST-traefik.me}
gateway: