使用阿里云容器服务快速搭建Odoo10

odoo 10.0 & postgres 9.4

使用Odoo10.0官方Docker镜像,快速搭建阿里云容器服务的Odoo线上环境。几分钟就能完成odoo和postgres的配置和启动,简单易用,使用起来非常方便。

Odoo Docker源码地址:

https://code.aliyun.com/noahzao/docker-odoo-7mud.git

Dockerfile

FROM registry.cn-shanghai.aliyuncs.com/iwcloud/docker-odoo:10.0 MAINTAINER Noah Wang <234082230@qq.com>

ADD config/odoo.conf /etc/odoo/odoo.conf

# Set default user when running the container USER odoo

ENTRYPOINT ["/entrypoint.sh"]

CMD ["odoo"]

以上Dockerfile继承自父镜像docker-odoo:10.0,同时父镜像是官方镜像的克隆。

config/odoo.conf

[options]

addons_path = /mnt/extra-addons,/usr/lib/python2.7/dist-packages/odoo/addons data_dir = /var/lib/odoo admin_passwd = please_change_password

; csv_internal_sep = ,

; db_maxconn = 64

; db_name = False

; db_template = template1

; dbfilter = .*

; debug_mode = False

; email_from = False

; limit_memory_hard = 2684354560

; limit_memory_soft = 2147483648

; limit_request = 8192

; limit_time_cpu = 60

; limit_time_real = 120

; list_db = True

; log_db = False

; log_handler = [':INFO']

; log_level = info

; logfile = None

; longpolling_port = 8072

; max_cron_threads = 2

; osv_memory_age_limit = 1.0

; osv_memory_count_limit = False

; smtp_password = False

; smtp_port = 25

; smtp_server = localhost

; smtp_ssl = False

; smtp_user = False

; workers = 0

; xmlrpc = True

; xmlrpc_interface =

; xmlrpc_port = 8069

; xmlrpcs = True

; xmlrpcs_interface =

; xmlrpcs_port = 8071

在odoo.conf中,可以自行加入一些需要的配置,比如上述文件中指定了admin_passwd。

Docker repository 镜像:

镜像名称: odoo-7mud

镜像性质: 公开

公网地址: docker pull registry.cn-shanghai.aliyuncs.com/7mud/odoo-7mud

经典内网: docker pull registry-internal.cn-shanghai.aliyuncs.com/7mud/odoo-7mud VPC网络:docker pull registry-vpc.cn-shanghai.aliyuncs.com/7mud/odoo-7mud

代码仓库: https://code.aliyun.com/noahzao/docker-odoo-7mud

镜像地域: 华东2

Postgres 9.4 配置:

postgres-94:

  image: 'registry-internal.cn-hangzhou.aliyuncs.com/iwcloud/postgres:9.4'

  mem_limit: 0

  environment:

    - POSTGRES_USER=odoo

    - POSTGRES_PASSWORD=PLEASE_CHANGE_YOUR_PASSWORD

    - PGDATA=/var/lib/postgresql/data/pgdata

    - 'constraint:aliyun.node_index==2'

  kernel_memory: 0

  memswap_reservation: 0

  restart: always

  shm_size: 0

  volumes:

    - '/mnt/data/postgres94:/var/lib/postgresql/data:rw'

  ports:

    - 'ESC_INTERNAL_IP:5431:5432/tcp'

  memswap_limit: 0

  labels:

    aliyun.scale: '1'

Odoo 10.0 配置:

odoo-7mud-demo:

  image: 'registry.cn-shanghai.aliyuncs.com/7mud/odoo-7mud:latest'

  mem_limit: 0

  environment:

    - HOST=POSGRES_IP

    - PORT=5432

    - USER=odoo

    - PASSWORD=PLEASE_CHANGE_YOUR_PASSWORD

    - 'constraint:aliyun.node_index==1'

  kernel_memory: 0

  memswap_reservation: 0

  restart: always

  shm_size: 0

  volumes:

    - '/mnt/data/odoo-7mud-demo:/var/lib/odoo:rw'

  ports:

    - 'ESC_INTERNAL_IP:18069:8069/tcp'

    - 'ESC_INTERNAL_IP:18072:8072/tcp'

  memswap_limit: 0

  labels:

    aliyun.scale: '1'