Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add first version to odoo saas docker #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

kaerdsar
Copy link

When you type docker run you get saas ready to use with portal and server database. Maybe we can add more configurations.

…et saas ready to use with portal and server database
@yelizariev
Copy link

Thanks. I'll try it soon.
Just one question. Do you have any reason why you don't use ready odoo docker, i.e.

FROM odoo:8.0

intead of

FROM debian:stable

@kaerdsar
Copy link
Author

Good question. I tried with 'FROM odoo' first but later in makedb.sh script I can't start postgresql server. The postgresql server is in other container, so I can't handle it from odoo container. Also I tried with docker-compose. If you have any idea I can upgrade the code, I still prefer use the official odoo docker image.

@yelizariev
Copy link

As I understand
odoo uses debian:jessie
jessie uses systemd
So, to start postgresql you have to use systemctl command. Something like

systemctl enable postgresql.service # maybe you can skip this
systemctl start postgresql.service
systemctl stop postgresql.service

@yelizariev
Copy link

I think postgres is in the same container. Am I wrong?
As I understand FROM ... just use other Dockerfile as a base and then you add extra commands

@yelizariev
Copy link

Another idea to update docker:
https://erppeek.readthedocs.org/
It allows to create database:
https://erppeek.readthedocs.org/en/latest/api.html#erppeek.Client.create_database
as well as create records without pseudo docker modules.

; db_maxconn = 64
; db_name = False
; db_template = template1
; dbfilter = .*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need dbfilter=^%h$

@yelizariev
Copy link

I tried, but odoo doesn't work. I see odoo top menu, but it doesn't work.
I get

Menu no action found web test 04 will fail

@kaerdsar
Copy link
Author

I add saas_portal_demo_example as we talked.

The main idea is after run docker get an odoo instance and could to click "Live Preview" on a plan. Now when you run docker you get an odoo instance with saas_portal_demo_example installed and two plans created. Before can click "Live Preview" you must generate a template database for each plan and before generate a template database the server must have the addons specified in plan (i.e. pos_product_available).

I don't have access to those addons, so I can't download them to the server. Also we have to fix how to get addons in create_template method, now it is using an old field (required_addons_ids) and the new model to specify addons is in saas_portal_demo module. I can't get "Live Preview" out of the box.

What do you think? Any idea?

@yelizariev
Copy link

pos_product_available can be found here: https://github.com/yelizariev/pos-addons

@yelizariev
Copy link

modules at saas_portal_demo are only for Plan's description. It should not used to install modules.

I am not sure about required_addons_ids field. I don't like it, because that field is used only to create template.
I think for our need we could use saas.config to install modules on template database.

create_template could be updated to use _request_server. Then we will be able to create database inside docker automatically. Right?

@kaerdsar
Copy link
Author

Could be. I'll try it.

@kaerdsar
Copy link
Author

kaerdsar commented Sep 4, 2015

This commit works if you accept the last pull request on odoo-saas-tools, because the docker run use the new create_template method.


# Download Pos Addons
RUN git clone https://github.com/yelizariev/pos-addons.git /mnt/pos-addons
RUN cp -a /mnt/pos-addons/. /mnt/odoo-saas-tools/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's not a typo
why are you doing it? I believe it's better don't mess addons.

@yelizariev
Copy link

@kaerdsar please clean up code and finish with Reminder Addons

RUN git clone https://github.com/yelizariev/pos-addons.git /mnt/pos-addons
RUN cp -a /mnt/pos-addons/. /mnt/odoo-saas-tools/

# Download Reminder Addons

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kaerdsar
Copy link
Author

Also include creation of a reminder template.

sed -i "s/server1.com</$SERVER_SUBDOMAIN</g" /mnt/odoo-saas-tools/saas_portal_demo_example/data/saas_portal_plan.xml
sed -i "s/server_subdomain/$SERVER_SUBDOMAIN/g" /mnt/odoo-saas-tools/saas_portal_docker/data/server.xml
sed -i "s/server_client_id/$uuid/g" /mnt/odoo-saas-tools/saas_portal_docker/data/server.xml
sed -i "s/server_client_id/$uuid/g" /mnt/odoo-saas-tools/saas_server_docker/data/provider.xml

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as I understand it should be

/mnt/odoo-saas-docker/...

@yelizariev
Copy link

There is an issue with path.

Could you fix it and build with --no-cache=true option to test everything ?

@yelizariev
Copy link

It seems, that it doesn't work, does it?

It seems, that odoo cannot handle http requests during database initialisation.

Maybe running 2 odoo instances (one for portal and one for server and databases) could be a solution?

@coodec
Copy link

coodec commented Feb 18, 2016

I think we should start using Odoo V9 in the docker image.

We also can use

FROM odoo:9.0

but the first line in the docker file should change the user

USER root

This way, we can continue, if not, as the default user is odoo, we can't do anything in the Odoo image.

@coodec
Copy link

coodec commented Feb 18, 2016

Also, I think that git should not be used directly on the container, as it will make harder to update modules, the user should install git on it's computer and then use link the directories to the container.

Something like:
docker run -p 8069:8069 --name container --link database_for_container:db -v /path/to/local/extra-addons:/mnt/extra-addons -t image_of_odoo --restart=always -s --addons-path=/mnt/extra-addons/repo1,/mnt/extra-addons/repo2,/mnt/extra-addons/repo3

This way working with repos becomes easier.

Daniel.

@yelizariev
Copy link

@coodec this is old PR. Consider to create new own PR. I don't think that @kaerdsar is going to continue his work

@coodec
Copy link

coodec commented Feb 19, 2016

I think that the first step for me should be have the installation up and running on my server, so later see if it's possible to do it on docker.

I can't get it to work on my server.

Daniel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants