Skip to content

Commit

Permalink
fix: adjust dir structure
Browse files Browse the repository at this point in the history
  • Loading branch information
rubencabrera committed Jul 4, 2024
1 parent 4191198 commit 89e2b23
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# DOCKER image to run odoo 16 with Odoo Community Backports and OCA addons

# WARNING: No work done yet for 16, this is a dummy release to keep track of
# it and move onto 16. Do not use.
FROM rubencabrera/odoo-base-image:16.0.1
MAINTAINER Rubén Cabrera Martínez <[email protected]>
EXPOSE 8069 8071 8072
Expand All @@ -10,15 +8,12 @@ ENV LANG C.UTF-8
RUN mkdir /opt/odoo; \
mkdir /var/log/odoo; \
mkdir /var/lib/odoo; \
mkdir /opt/repos; \
mkdir -p /opt/repos/oca; \
mkdir -p /opt/repos/other
RUN useradd --home /opt/odoo --shell /bin/bash odoo
RUN chown -R odoo:odoo /opt/odoo; chown -R odoo:odoo /var/lib/odoo; \
chown -R odoo:odoo /var/log/odoo; chown -R odoo:odoo /opt/repos

# Con lo siguiente, cambiamos al usuario odoo y el path donde ejecuta los
# comandos que se indiquen después.
USER odoo
WORKDIR /opt/odoo
RUN git clone --branch 16.0 --depth 1 https://github.com/oca/ocb.git /opt/odoo
Expand Down Expand Up @@ -90,7 +85,7 @@ WORKDIR /opt
USER root
RUN mkdir /opt/config
COPY ./odoo-server.conf /opt/config/odoo-server.conf
ENV OPENERP_SERVER /opt/config/odoo-server.conf
ENV OPENERP_SERVER_CONF /opt/config/odoo-server.conf

RUN chown -R odoo:odoo /opt/config
RUN sed -i '/^#.*Storage/s/^#//' /etc/systemd/journald.conf
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ be much better with something above 4GB.

## Running with docker-compose

Run `docker-compose up` in the root path.

## Environment variables
1. Set the environment variables used in `docker-compose.yml` to
configure how docker compose will behave:
`ODOO_DOCKER_PROJECT_NAME` and `ODOO_DOCKER_REPOS_HOST_PATH`.
1. Review other `FIXME`s in that same file (like creating or setting the path
for your code volume).
1. Set other environment variables in the odoo16 container for the Odoo server
config (see section below, look at `DB_FILTER` especially for local
development).
1. Run `docker-compose up` in the root path.

## Odoo server config using environment variables

Odoo uses a config file that is a bit of a pain with a docker
container. This images allow you to pass those config values in
Expand Down
14 changes: 9 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,28 @@ services:
db:
condition: service_healthy
restart: true
image: "rubencabrera/odoo-docker:16.0.5"
environment:
- DB_FILTER=.*
image: "rubencabrera/odoo-docker:16.1.0"
ports:
- "8069:8069"
- "8071:8071"
- "8072:8072"
restart: always
volumes:
- code_volume:/opt
- code_volume:/opt/repos
- odoo_data:/var/lib/odoo
volumes:
code_volume:
# This is where the code will live.
# This is where the code will live. For local development, you might want
# to use something owned by your user.
driver: local
driver_opts:
o: bind
type: none
# FIXME: The local paths need to exist for volumes to be mounted
device: ${ODOO_DOCKER_OPT_HOST_PATH:-${HOME}/.odoo_docker_opt}
# FIXME: The local paths need to exist for volumes to be mounted.
# For prod environments, this might be better inside a dir in `/opt`
device: ${ODOO_DOCKER_REPOS_HOST_PATH:-${HOME}/.${COMPOSE_PROJECT_NAME}_repos}
name: ${COMPOSE_PROJECT_NAME}_code
data_storage:
name: ${COMPOSE_PROJECT_NAME}_data_storage
Expand Down

0 comments on commit 89e2b23

Please sign in to comment.