forked from Tecnativa/doodba-copier-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devel.yaml.jinja
135 lines (127 loc) · 3.43 KB
/
devel.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{%- import "_macros.jinja" as macros -%}
{% set whitelisted_hosts = (
"cdnjs.cloudflare.com",
"fonts.googleapis.com",
"fonts.gstatic.com",
"www.google.com",
"www.googleapis.com",
"www.gravatar.com",
) -%}
version: "2.4"
services:
odoo_proxy:
image: ghcr.io/tecnativa/docker-whitelist:latest
depends_on:
- odoo
networks: &public
default:
public:
ports:
- "127.0.0.1:{{ macros.version_major(odoo_version) }}899:6899"
- "127.0.0.1:{{ macros.version_major(odoo_version) }}069:8069"
- "127.0.0.1:{{ macros.version_major(odoo_version) }}072:8072"
environment:
PORT: "6899 8069 8072"
TARGET: odoo
odoo:
extends:
file: common.yaml
service: odoo
build:
args:
# To aggregate in development, use `setup-devel.yaml`
AGGREGATE: "false"
# Export these variables to own files created by odoo in your filesystem
UID: "${UID:-1000}"
GID: "${GID:-1000}"
# No need for this in development
PIP_INSTALL_ODOO: "false"
CLEAN: "false"
COMPILE: "false"
environment:
DOODBA_ENVIRONMENT: "${DOODBA_ENVIRONMENT-devel}"
LIST_DB: "true"
DEBUGPY_ENABLE: "${DOODBA_DEBUGPY_ENABLE:-0}"
PGDATABASE: &dbname devel
PYTHONDONTWRITEBYTECODE: 1
PYTHONOPTIMIZE: ""
PYTHONPATH: /opt/odoo/custom/src/odoo
SMTP_PORT: "1025"
WDB_WEB_PORT: "{{ macros.version_major(odoo_version) }}984"
# To avoid installing demo data export DOODBA_WITHOUT_DEMO=all
WITHOUT_DEMO: "${DOODBA_WITHOUT_DEMO-false}"
volumes:
- ./odoo/custom:/opt/odoo/custom:ro,z
- ./odoo/auto:/opt/odoo/auto:rw,z
depends_on:
- db
{% for host in whitelisted_hosts -%}
- proxy_{{ host|replace(".", "_") }}
{% endfor -%}
- smtp
- wdb
command:
- odoo
- --limit-memory-soft=0
{%- if odoo_version >= 10 %}
- --limit-time-real-cron=9999999
{%- endif %}
- --limit-time-real=9999999
- --workers=0
{%- if odoo_version == 9 %}
- --dev
{%- elif odoo_version >= 10 %}
- --dev=reload,qweb,werkzeug,xml
{%- endif %}
{% if postgres_version -%}
db:
extends:
file: common.yaml
service: db
environment:
POSTGRES_DB: *dbname
POSTGRES_PASSWORD: odoopassword
{%- endif %}
pgweb:
image: docker.io/sosedoff/pgweb
networks: *public
ports:
- "127.0.0.1:{{ macros.version_major(odoo_version) }}081:8081"
environment:
DATABASE_URL: postgres://{{ postgres_username }}:odoopassword@db:5432/devel?sslmode=disable
depends_on:
- db
smtp:
extends:
file: common.yaml
service: smtpfake
networks: *public
ports:
- "127.0.0.1:{{ macros.version_major(odoo_version) }}025:8025"
wdb:
image: docker.io/kozea/wdb
networks: *public
ports:
- "127.0.0.1:{{ macros.version_major(odoo_version) }}984:1984"
# HACK https://github.com/Kozea/wdb/issues/136
init: true
# Whitelist outgoing traffic for tests, reports, etc.
{%- for host in whitelisted_hosts %}
proxy_{{ host|replace(".", "_") }}:
image: ghcr.io/tecnativa/docker-whitelist:latest
networks:
default:
aliases:
- {{ host }}
public:
environment:
TARGET: {{ host }}
PRE_RESOLVE: 1
{% endfor %}
networks:
default:
internal: ${DOODBA_NETWORK_INTERNAL-true}
public:
volumes:
filestore:
db: