Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git
__pycache__
*.pyc
*.pyo
*.pyd
*.db
*.sqlite3
*.egg-info
dist
build
*.log
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM odoo:17

USER root

WORKDIR /opt/odoo

COPY requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt

COPY . /opt/odoo/runbot
COPY runbot_builder /opt/odoo/runbot_builder
COPY scripts /opt/odoo/scripts

ENV ADDONS_PATH=/usr/lib/python3/dist-packages/odoo/addons,/opt/odoo/runbot

RUN mkdir -p /var/log/odoo && \
chmod +x /opt/odoo/scripts/*.sh

USER odoo

ENTRYPOINT ["/entrypoint.sh"]
CMD ["odoo"]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,3 +315,17 @@ Or by providing a plain Dockerfile in the template.
Once the Dockerfile is created and the `to_build` field is checked, the Dockerfile will be built (pay attention that no other operations will occur during the build).

A version or a bundle can be assigned a specific Dockerfile.

## Docker Compose

For a quick local setup the project can be started using Docker. If the
image is not built yet, run `docker compose build` first and then start
the services with:

```bash
docker compose up
```

This command will start PostgreSQL together with the Runbot, builder and
leader services. Once the initialization is complete the Runbot interface
will be reachable on [http://localhost:8069](http://localhost:8069).
65 changes: 65 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: '3.8'
services:
db:
image: postgres:15
environment:
POSTGRES_DB: runbot
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "odoo"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped

runbot:
build: .
command: ["/opt/odoo/scripts/runbot.sh"]
depends_on:
db:
condition: service_healthy
ports:
- "8069:8069"
environment:
DB_HOST: db
DB_USER: odoo
DB_PASSWORD: odoo
DB_NAME: runbot
ADDONS_PATH: "/usr/lib/python3/dist-packages/odoo/addons,/opt/odoo/runbot"
restart: unless-stopped

builder:
build: .
command: ["/opt/odoo/scripts/builder.sh"]
depends_on:
db:
condition: service_healthy
environment:
DB_HOST: db
DB_USER: odoo
DB_PASSWORD: odoo
DB_NAME: runbot
ADDONS_PATH: "/usr/lib/python3/dist-packages/odoo/addons,/opt/odoo/runbot"
FORCED_HOST_NAME: builder
restart: unless-stopped

leader:
build: .
command: ["/opt/odoo/scripts/leader.sh"]
depends_on:
db:
condition: service_healthy
environment:
DB_HOST: db
DB_USER: odoo
DB_PASSWORD: odoo
DB_NAME: runbot
ADDONS_PATH: "/usr/lib/python3/dist-packages/odoo/addons,/opt/odoo/runbot"
FORCED_HOST_NAME: leader
restart: unless-stopped

volumes:
pgdata:
11 changes: 11 additions & 0 deletions scripts/builder.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e
exec python3 /opt/odoo/runbot_builder/builder.py \
--odoo-path=/usr/lib/python3/dist-packages/odoo \
--addons-path=${ADDONS_PATH} \
-d ${DB_NAME:-runbot} \
--db_host=${DB_HOST:-db} \
--db_port=${DB_PORT:-5432} \
--db_user=${DB_USER:-odoo} \
--db_password=${DB_PASSWORD:-odoo} \
--forced-host-name=${FORCED_HOST_NAME:-builder}
11 changes: 11 additions & 0 deletions scripts/leader.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
set -e
exec python3 /opt/odoo/runbot_builder/leader.py \
--odoo-path=/usr/lib/python3/dist-packages/odoo \
--addons-path=${ADDONS_PATH} \
-d ${DB_NAME:-runbot} \
--db_host=${DB_HOST:-db} \
--db_port=${DB_PORT:-5432} \
--db_user=${DB_USER:-odoo} \
--db_password=${DB_PASSWORD:-odoo} \
--forced-host-name=${FORCED_HOST_NAME:-leader}
9 changes: 9 additions & 0 deletions scripts/runbot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e
exec odoo --workers=2 --without-demo=1 --max-cron-threads=1 \
--addons-path=${ADDONS_PATH} \
-d ${DB_NAME:-runbot} \
--db_host=${DB_HOST:-db} \
--db_port=${DB_PORT:-5432} \
--db_user=${DB_USER:-odoo} \
--db_password=${DB_PASSWORD:-odoo}