Przeglądaj źródła

Merge pull request #198 from aaronraimist/access-database

Add config option to be able to access database outside of container
pull/200/head
Slavi Pantaleev 6 lat temu
committed by GitHub
rodzic
commit
62ab3cd82e
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 11 dodań i 0 usunięć
  1. +8
    -0
      roles/matrix-postgres/defaults/main.yml
  2. +3
    -0
      roles/matrix-postgres/templates/systemd/matrix-postgres.service.j2

+ 8
- 0
roles/matrix-postgres/defaults/main.yml Wyświetl plik

@@ -15,3 +15,11 @@ matrix_postgres_docker_image_latest: "{{ matrix_postgres_docker_image_v11 }}"


# A list of extra arguments to pass to the container # A list of extra arguments to pass to the container
matrix_postgres_container_extra_arguments: [] matrix_postgres_container_extra_arguments: []

# Controls whether the matrix-postgres container exposes a port (tcp/5432 in the
# container) that can be used to access the database from outside the container (e.g. with psql)
#
# psql postgresql://username:password@localhost:<port>/database_name
#
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:5432"), or empty string to not expose.
matrix_postgres_container_postgres_bind_port: ""

+ 3
- 0
roles/matrix-postgres/templates/systemd/matrix-postgres.service.j2 Wyświetl plik

@@ -17,6 +17,9 @@ ExecStart=/usr/bin/docker run --rm --name matrix-postgres \
--tmpfs=/tmp:rw,noexec,nosuid,size=100m \ --tmpfs=/tmp:rw,noexec,nosuid,size=100m \
--tmpfs=/run/postgresql:rw,noexec,nosuid,size=100m \ --tmpfs=/run/postgresql:rw,noexec,nosuid,size=100m \
--network={{ matrix_docker_network }} \ --network={{ matrix_docker_network }} \
{% if matrix_postgres_container_postgres_bind_port %}
-p {{ matrix_postgres_container_postgres_bind_port }}:5432 \
{% endif %}
--env-file={{ matrix_postgres_base_path }}/env-postgres-server \ --env-file={{ matrix_postgres_base_path }}/env-postgres-server \
-v {{ matrix_postgres_data_path }}:/var/lib/postgresql/data:rw \ -v {{ matrix_postgres_data_path }}:/var/lib/postgresql/data:rw \
-v /etc/passwd:/etc/passwd:ro \ -v /etc/passwd:/etc/passwd:ro \


Ładowanie…
Anuluj
Zapisz