Skip to content
This repository was archived by the owner on Jan 12, 2022. It is now read-only.

Commit b301978

Browse files
committed
Add logging and backups
1 parent 64c3a9e commit b301978

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ POSTFIX_RELAYHOST=
4747
POSTFIX_RELAYHOST_PORT=587
4848
POSTFIX_SASL_AUTH=
4949
POSTFIX_TLS=
50+
51+
# Configure docker log driver - currently supports 'none', 'syslog' or 'journald'
52+
LOG_DRIVER=syslog

docker-compose.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22

33
version: '3.6'
44

5+
x-linux-logging:
6+
&common-logging
7+
driver: "${LOG_DRIVER}"
8+
options:
9+
tag: "{{.ImageName}}/{{.Name}}/{{.ID}}"
10+
511
services:
612
nginx-php-moodle:
713
networks:
814
db:
915
mail:
1016
image: ${DOCKER_REGISTRY_URL}/nginx-php-moodle:latest
17+
logging: *common-logging
1118
depends_on:
1219
- postfix
1320
- postgres
@@ -60,10 +67,12 @@ services:
6067
POSTFIX_RELAYHOST_PORT:
6168
POSTFIX_SASL_AUTH:
6269
POSTFIX_TLS:
70+
logging: *common-logging
6371
postgres:
6472
networks:
6573
db:
6674
image: ${DOCKER_REGISTRY_URL}/postgres:9.6
75+
logging: *common-logging
6776
environment:
6877
POSTGRES_DB: "${PGSQL_DATABASE}"
6978
POSTGRES_USER: "${PGSQL_USER}"
@@ -72,10 +81,27 @@ services:
7281
- type: volume
7382
source: db
7483
target: /var/lib/postgresql/data
84+
postgres-backup:
85+
image: ${DOCKER_REGISTRY_URL}/postgres-backup:latest
86+
depends_on:
87+
- "postgres"
88+
volumes:
89+
- ./backup:/backup:Z
90+
environment:
91+
POSTGRES_PASSWORD: "${PGSQL_PASSWORD}"
92+
POSTGRES_USER: "${PGSQL_USER}"
93+
POSTGRES_DB: "${PGSQL_DATABASE}"
94+
DUMPPREFIX: "backup"
95+
POSTGRES_HOST: "db"
96+
POSTGRES_PORT: "5432"
97+
logging: *common-logging
98+
networks:
99+
db:
75100
certbot:
76101
networks:
77102
certbot:
78103
image: ${DOCKER_REGISTRY_URL}/sc-certbot:latest
104+
logging: *common-logging
79105
depends_on:
80106
- nginx-php-moodle
81107
environment:

0 commit comments

Comments
 (0)