Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
guewen committed Jul 30, 2018
1 parent a259748 commit f8e2b25
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 49 deletions.
7 changes: 2 additions & 5 deletions example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Follow the steps:

1. Create directories. This is mandatory, they will be copied in the image

mkdir -p odoo/external-src odoo/local-src odoo/data odoo/features
mkdir -p odoo/external-src odoo/local-src odoo/data odoo/songs

2. Add a submodule for Odoo (official or OCA/OCB)

Expand All @@ -21,13 +21,10 @@ Follow the steps:

4. Optionally add custom addons in `odoo/local-src`

5. Copy the configuration template `etc/openerp.cfg.tmpl` in your project, see [the example file](odoo/etc/openerp.cfg.tmpl).
Adapt the `addons_path` and the other options if needed.

6. Create the Dockerfile, the bare minimum being (see also [the example
file](odoo/Dockerfile) that installs additional dependencies):

FROM camptocamp/odoo-project:9.0
FROM camptocamp/odoo-project:11.0
MAINTAINER <name>

ENV ADDONS_PATH=/opt/odoo/local-src,/opt/odoo/external-src/server-tools,/opt/odoo/src/addons
Expand Down
33 changes: 0 additions & 33 deletions example/docker-compose.override.yml

This file was deleted.

18 changes: 16 additions & 2 deletions example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,32 @@ version: '2'

services:
odoo:
tty: true
stdin_open: true
build: ./odoo/
ports:
- 8069
depends_on:
- db
volumes:
- "data-odoo:/data/odoo"
- "data-odoo-pytest-cache:/opt/odoo/.cache"
# to speed build of image customise your .dockerignore (this is an help there)
- "./odoo:/opt/odoo"
environment:
- DB_USER=odoo
- DB_PASS=odoo
- DB_NAME=odoodb
- ADMIN_PASSWD=# set me
- RUNNING_ENV=dev
- MARABUNTA_MODE=demo
- LOG_HANDLER=:WARN
- MARABUNTA_MODE=demo # could be 'full' for the db with all the data
- MARABUNTA_ALLOW_SERIE=True # should not be set in production

db:
image: postgres:9.6
ports:
- 5432
environment:
- POSTGRES_USER=odoo
- POSTGRES_PASSWORD=odoo
Expand All @@ -28,10 +38,14 @@ services:

# can be useful for dev when longpolling is required
nginx:
image: camptocamp/odoo-nginx:9.0-1.2.1
image: camptocamp/odoo-nginx:11.0-1.3.0
ports:
- 80:80
depends_on:
- odoo

volumes:
data-odoo:
data-db:
# store pytest cache, allowing to use --lf or --ff (replay last or first failures)
data-odoo-pytest-cache:
11 changes: 6 additions & 5 deletions example/odoo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM camptocamp/odoo-project:10.0-latest
FROM camptocamp/odoo-project:11.0-latest
MAINTAINER Camptocamp

# For installing odoo you have two possibility adding the whole root directory
# For installing odoo you have two possibility
# 1. either adding the whole root directory
#COPY . /opt/odoo

# or adding each directory, this solution will reduce the download time
# of the image on the server (we can reuse layout)
# 2. or adding each directory, this solution will reduce the build and download
# time of the image on the server (layers are reused)
COPY ./src /opt/odoo/src
COPY ./external-src /opt/odoo/external-src
COPY ./local-src /opt/odoo/local-src
Expand All @@ -27,6 +28,6 @@ RUN set -x; \
&& rm -rf /var/lib/apt/lists/*

COPY ./requirements.txt /opt/odoo/
RUN cd /opt/odoo && pip install -r requirements.txt
RUN cd /opt/odoo && pip3 install -r requirements.txt

ENV ADDONS_PATH=/opt/odoo/local-src,/opt/odoo/src/addons
4 changes: 2 additions & 2 deletions example/odoo/Dockerfile-onbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM camptocamp/odoo-project:10.0-latest-onbuild
FROM camptocamp/odoo-project:11.0-latest-onbuild
MAINTAINER Camptocamp

# Project's specifics packages
Expand All @@ -10,6 +10,6 @@ RUN set -x; \
&& rm -rf /var/lib/apt/lists/*

COPY ./requirements.txt /opt/odoo/
RUN cd /opt/odoo && pip install -r requirements.txt
RUN cd /opt/odoo && pip3 install -r requirements.txt

ENV ADDONS_PATH=/opt/odoo/local-src,/opt/odoo/src/addons
2 changes: 1 addition & 1 deletion example/odoo/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.0
11.0.0
2 changes: 1 addition & 1 deletion example/odoo/migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ migration:
options:
install_command: odoo
versions:
- version: 9.0.0
- version: 11.0.0
operations:
pre:
- "sh -c 'psql -c \"CREATE EXTENSION pg_trgm;\"'"
Expand Down

0 comments on commit f8e2b25

Please sign in to comment.