forked from Tecnativa/doodba-copier-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.yaml.jinja
102 lines (97 loc) · 2.83 KB
/
common.yaml.jinja
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
version: "2.4"
services:
odoo:
{%- if odoo_oci_image %}
image: $ODOO_IMAGE:$ODOO_MINOR
{%- endif %}
build:
context: ./odoo
args:
ODOO_VERSION: $ODOO_MINOR
UID: "${UID:-1000}"
GID: "${GID:-1000}"
environment:
EMAIL_FROM: "$SMTP_DEFAULT_FROM"
PGDATABASE: &dbname {{ postgres_dbname }}
PGUSER: &dbuser "$DB_USER"
DB_FILTER: "$DB_FILTER"
PROXY_MODE: "$ODOO_PROXY_MODE"
hostname: "$SMTP_REAL_NON_CANONICAL_DEFAULT"
tty: true
volumes:
- filestore:/var/lib/odoo:z
{%- if odoo_proxy == "traefik" %}
labels:
traefik.backend.buffering.retryExpression: IsNetworkError() && Attempts() < 5
traefik.docker.network: "inverseproxy_shared"
traefik.enable: "true"
traefik.frontend.passHostHeader: "true"
traefik.longpolling.port: "8072"
traefik.port: "8069"
{%- endif %}
db:
image: tecnativa/postgres-autoconf:${DB_VERSION}-alpine
shm_size: 512mb
environment:
POSTGRES_DB: *dbname
POSTGRES_USER: *dbuser
CONF_EXTRA: |
work_mem = 32MB
volumes:
- db:/var/lib/postgresql/data:z
smtpfake:
image: mailhog/mailhog
{%- if smtp_relay_host %}
smtpreal:
image: tvial/docker-mailserver:latest
domainname: "$SMTP_REAL_MAILNAME"
stop_grace_period: 1m
volumes:
- mailconfig:/tmp/docker-mailserver:z
- maildata:/var/mail:z
- maillogs:/var/log/mail:z
- maillogssupervisord:/var/log/supervisor:z
- mailstate:/var/mail-state:z
cap_add:
- SYS_PTRACE
environment:
DEFAULT_RELAY_HOST: "[$SMTP_REAL_RELAY_HOST]:$SMTP_REAL_RELAY_PORT"
DMS_DEBUG: 0
ENABLE_SRS: 1
ONE_DIR: 1
PERMIT_DOCKER: connected-networks
POSTFIX_MESSAGE_SIZE_LIMIT: 52428800 # 50 MiB
RELAY_HOST: "$SMTP_REAL_RELAY_HOST"
RELAY_PORT: "$SMTP_REAL_RELAY_PORT"
RELAY_USER: "$SMTP_REAL_RELAY_USER"
SMTP_ONLY: 1
SRS_DOMAINNAME: "$SMTP_REAL_NON_CANONICAL_DEFAULT"
SRS_EXCLUDE_DOMAINS: "$SMTP_REAL_CANONICAL_DOMAINS"
SRS_SENDER_CLASSES: envelope_sender,header_sender
{%- endif %}
{%- if backup_dst %}
backup:
image: tecnativa/duplicity:postgres{% if backup_dst.startswith('s3://') %}-s3{% endif %}
hostname: backup
domainname: "$DOMAIN_PROD"
init: true
environment:
DST: "$BACKUP_DST"
{%- if smtp_relay_host %}
EMAIL_FROM: "$BACKUP_EMAIL_FROM"
EMAIL_TO: "$BACKUP_EMAIL_TO"
{%- endif %}
{%- if backup_deletion %}
JOB_800_WHAT: dup --force remove-older-than 3M $$DST
JOB_800_WHEN: weekly
{%- endif %}
PGDATABASE: *dbname
PGUSER: *dbuser
{%- if smtp_relay_host %}
SMTP_HOST: smtplocal
{%- endif %}
TZ: "$BACKUP_TZ"
volumes:
- backup_cache:/root:z
- filestore:/mnt/backup/src/odoo:z
{%- endif %}