Giter Club home page Giter Club logo

junari-odoo-docker's Introduction

Junari Odoo Docker image

We now deploy seperate tags per version:
junari/odoo:14.0   <- Latest v14 image
junari/odoo:14.0-YYYY-MM-DD-GITREV   <- v14 at a specific revision

Junari Open Source Docker image for Odoo Development and Production

  • Python 3.8 / Debian Bullseye
  • Odoo Community Edition, installed from source in /opt/odoo
  • Supports custom addons in /opt/odoo/custom_addons
  • Includes an odoo-config script for modifying the odoo config file in derrived images
  • Includes Git and SSH clients for development
  • Includes Visual Studio Code folder mount points
  • Allows easy passing of additional odoo args, or running other commands like the bash shell

Set-up

Prerequisites

Configuring

This image requires the following environment variables.

  • DB_HOST - Postgres Database server address. Set to host.docker.internal to use your local machine.
  • DB_PORT - Postgres Database server port. Normally 5432
  • DB_USER - Odoo database user. This must NOT be your PostgreSQL super user (postgres)
  • DB_PASSWORD - Odoo database user password.

We recommend creating an odoo.env file to store your database configuration. Check out odoo.env-example for an example.

Overriding Odoo Configuration Settings

This image ships with a default odoo.conf in /etc/odoo. You can either replace this file with your own version, or use our odoo-config tool to update individual settings.

To override individual settings, create and build you own Dockerfile with content such as the below:

FROM junari/odoo:14.0

RUN odoo-config addons_path+=,/opt/odoo/custom_addons/my_lib/addons \
                list_db=True

(you can either append to existing settings using +=, or overwrite them using =)

Creating a database and running the image

The following example walks you through creating a new Odoo database using this image:

  1. In a new folder, create an odoo.env file, as above

  2. Create a blank PostgreSQL database owned by your Odoo database user, e.g.

CREATE DATABASE odoo14 OWNER odoo ENCODING UTF8;
  1. Run this image with the following command in the Terminal (or in Git Bash on Windows) to initialise your new Odoo database
docker run --rm -it \
    -v junari-odoo-data:/opt/odoo/data \
    -p 8069:8069 \
    --env-file=odoo.env \
    junari/odoo \
    odoo -d odoo14 -i base --without-demo=all --load-language=en_GB --stop-after-init

(where odoo14 is the new database name)

  1. Now that your database has been initialised, you can restart it with a simpler command. You might find it useful to save the below into a start-odoo.sh script, which you can run instead of typing it out!
docker run --rm -it \
    -v junari-odoo-data:/opt/odoo/data \
    -p 8069:8069 \
    --env-file=odoo.env \
    junari/odoo odoo -d odoo14

Your Odoo system should now be accessible at http://localhost:8069 . You can log in using the default user: admin, password: admin

Development

Running

The below script should be run in Git Bash on windows, or in the Terminal application on Mac and Linux

# Run the junari/odoo docker image with default settings
./run.sh

You can also pass any odoo-bin args via run.sh, e.g.:

# Initialise a new database (with demo data disabled)
./run.sh odoo -d db_name -i base --without-demo=all --load-language=en_GB

# Run with a specific database
./run.sh odoo -d db_name

# Access the odoo shell for a specific database
./run.sh odoo-shell -d db_name

# Access bash inside the container
./run.sh bash

Re-building the image

# Re-build the images (with the latest ubuntu)
./build.sh

junari-odoo-docker's People

Contributors

dupski avatar rg1bb5 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.