2020-05-19 15:27:10 +00:00
|
|
|
version: '2.3'
|
2018-10-15 14:49:23 +00:00
|
|
|
services:
|
|
|
|
postgres1:
|
|
|
|
image: postgres
|
2021-04-07 12:22:53 +00:00
|
|
|
command: ["postgres", "-c", "logging_collector=on", "-c", "log_directory=/postgres/logs", "-c", "log_filename=postgresql.log", "-c", "log_statement=all"]
|
2018-10-15 14:49:23 +00:00
|
|
|
restart: always
|
2021-03-19 12:33:14 +00:00
|
|
|
expose:
|
|
|
|
- ${POSTGRES_PORT}
|
2021-02-17 15:40:01 +00:00
|
|
|
healthcheck:
|
2021-02-24 12:42:20 +00:00
|
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
2020-06-22 13:29:35 +00:00
|
|
|
networks:
|
|
|
|
default:
|
|
|
|
aliases:
|
2021-02-24 12:42:20 +00:00
|
|
|
- postgre-sql.local
|
2021-02-17 15:40:01 +00:00
|
|
|
environment:
|
2021-02-24 12:42:20 +00:00
|
|
|
POSTGRES_HOST_AUTH_METHOD: "trust"
|
|
|
|
POSTGRES_PASSWORD: mysecretpassword
|
2021-03-19 12:33:14 +00:00
|
|
|
PGDATA: /postgres/data
|
|
|
|
volumes:
|
|
|
|
- type: ${POSTGRES_LOGS_FS:-tmpfs}
|
|
|
|
source: ${POSTGRES_DIR:-}
|
|
|
|
target: /postgres/
|
2021-03-14 08:35:07 +00:00
|
|
|
postgres2:
|
|
|
|
image: postgres
|
2021-04-07 12:22:53 +00:00
|
|
|
command: ["postgres", "-c", "logging_collector=on", "-c", "log_directory=/postgres/logs", "-c", "log_filename=postgresql.log", "-c", "log_statement=all"]
|
2021-03-14 08:35:07 +00:00
|
|
|
restart: always
|
|
|
|
environment:
|
2021-03-19 12:33:14 +00:00
|
|
|
POSTGRES_HOST_AUTH_METHOD: "trust"
|
2021-03-14 08:35:07 +00:00
|
|
|
POSTGRES_PASSWORD: mysecretpassword
|
2021-03-19 12:33:14 +00:00
|
|
|
PGDATA: /postgres/data
|
|
|
|
expose:
|
|
|
|
- ${POSTGRES_PORT}
|
|
|
|
volumes:
|
|
|
|
- type: ${POSTGRES_LOGS_FS:-tmpfs}
|
|
|
|
source: ${POSTGRES2_DIR:-}
|
2021-04-07 12:22:53 +00:00
|
|
|
target: /postgres/
|