Skip to content

Commit 9fbe730

Browse files
[REF] docker-compose: Allow easier module debug
This might break actual standalone deployments, as a named volume was added. But it also makes it easier to develop with hosted modules, as both approaches now support hosted modules
1 parent a3f881c commit 9fbe730

File tree

7 files changed

+16
-25
lines changed

7 files changed

+16
-25
lines changed

.devcontainer/.vscode/launch.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"request": "launch",
88
"redirectOutput": false,
99
"cwd": "${workspaceRoot}",
10-
"program": "/usr/local/bin/odoo",
10+
"program": "/opt/odoo/odoo-bin",
1111
"args": [
1212
"--config=/etc/odoo/odoo.conf",
1313
"--log-level=info",
@@ -20,7 +20,7 @@
2020
"redirectOutput": false,
2121
"cwd": "${workspaceRoot}",
2222
"justMyCode": false,
23-
"program": "/usr/local/bin/odoo",
23+
"program": "/opt/odoo/odoo-bin",
2424
"args": [
2525
"--config=/etc/odoo/odoo.conf",
2626
"--dev=qweb,werkzeug,xml",
@@ -33,7 +33,7 @@
3333
"request": "launch",
3434
"redirectOutput": false,
3535
"cwd": "${workspaceRoot}",
36-
"program": "/usr/local/bin/odoo",
36+
"program": "/opt/odoo/odoo-bin",
3737
"args": [
3838
"--config=/etc/odoo/odoo.conf",
3939
"--log-level=info",
@@ -47,7 +47,7 @@
4747
"request": "launch",
4848
"redirectOutput": false,
4949
"cwd": "${workspaceRoot}",
50-
"program": "/usr/local/bin/odoo",
50+
"program": "/opt/odoo/odoo-bin",
5151
"args": [
5252
"--config=/etc/odoo/odoo.conf",
5353
"--log-level=info",

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ ENV PIP_AUTO_INSTALL=${PIP_AUTO_INSTALL:-"0"}
144144
# Run tests for all the modules in the custom addons
145145
ENV RUN_TESTS=${RUN_TESTS:-"0"}
146146

147-
ENV DEBUGPY_ARGS="--listen 0.0.0.0:6899 --wait-for-client" \
147+
ENV DEBUGPY_ARGS="--listen 0.0.0.0:5678 --wait-for-client" \
148148
DEBUGPY_ENABLE=0
149149

150150
# Create app user

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Dockerized Odoo for Odoo 11.0
1+
# Dockerized Odoo
22

3-
This is a flexible and **streamlined** version of most Odoo docker projects that you'll find. And one that allows you to deploy with two different methods using the same Dockerfile:
3+
This is a flexible and **streamlined** version of most dockerized Odoo projects that you'll find. And one that allows you to deploy with two different methods using the same Dockerfile:
44

55
* **Standalone**: As most people use their implementation. With Odoo's source code inside the container. **This is the default**
66
* **Hosted**: A more practical deployment for **development**, as the HOST (where docker is installed) has the source code, and each container uses this single source.

dev-hosted.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ services:
1212
# ------------------------
1313

1414
odoo:
15-
# Uncomment the next lines to build the image. This is mainly useful
16-
# when you need to add additional requirements on the building phase
17-
#build:
18-
# context: .
19-
# dockerfile: Dockerfile
2015
volumes:
2116
# Host paths (odoo modules, src code & conf)
2217
- ./custom:${ODOO_EXTRA_ADDONS}:delegated
@@ -28,5 +23,6 @@ services:
2823
- WDB_SOCKET_SERVER=wdb
2924
- WDB_NO_BROWSER_AUTO_OPEN=True
3025
- WDB_WEB_PORT=1984
31-
command: ["${ODOO_CMD}", "--dev", "wdb,reload,qweb,werkzeug,xml"]
26+
- DEBUGPY_ENABLE=1
3227
depends_on: ["db", "wdb"]
28+
command: ["${ODOO_CMD}", "--dev", "wdb,reload,qweb,werkzeug,xml"]

dev-standalone.yml

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,26 @@
11
version: "3.7"
22

3-
volumes:
4-
odoo-modules:
5-
63
services:
74
wdb:
85
image: kozea/wdb:3.3.0
96
ports: ["1984:1984"]
7+
restart: unless-stopped
108
networks:
119
- odoonet
1210
depends_on: ["db"]
1311

1412
# ------------------------
1513

1614
odoo:
17-
# Uncomment the next lines to build the image. This is mainly useful
18-
# when you need to add additional requirements on the building phase
19-
#build:
20-
# context: .
21-
# dockerfile: Dockerfile
2215
volumes:
23-
# Named volumes (third party modules)
24-
- odoo-modules:${ODOO_EXTRA_ADDONS}
16+
# Host paths (odoo modules, src code & conf)
17+
- ./custom:${ODOO_EXTRA_ADDONS}:delegated
2518
environment:
2619
- LOG_LEVEL=debug
2720
- WITHOUT_DEMO=False
2821
- WDB_SOCKET_SERVER=wdb
2922
- WDB_NO_BROWSER_AUTO_OPEN=True
3023
- WDB_WEB_PORT=1984
24+
- DEBUGPY_ENABLE=1
3125
depends_on: ["db", "wdb"]
3226
command: ["odoo", "--dev", "wdb,reload,qweb,werkzeug,xml"]

docker-compose.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ networks:
99
volumes:
1010
odoo-data:
1111
odoo-testlogs:
12+
odoo-modules:
1213
psql:
1314

1415
services:
@@ -26,7 +27,7 @@ services:
2627
# Named volumes
2728
- odoo-data:${ODOO_DATA_DIR}
2829
- odoo-testlogs:${ODOO_LOGS_DIR}
29-
30+
- odoo-modules:${ODOO_EXTRA_ADDONS}
3031
depends_on:
3132
- db
3233

hosted.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ services:
99
# dockerfile: Dockerfile
1010
volumes:
1111
# Host paths (odoo src code & .vscode conf)
12-
- ./src/odoo:/${ODOO_BASEPATH}
12+
- ./src/odoo:/${ODOO_BASEPATH}:delegated

0 commit comments

Comments
 (0)