c2p

dockerfile

FROM ubuntu:20.04
RUN apt-get update && apt-get install ca-certificates tzdata  -y
ADD sources.list /etc/apt/sources.list
RUN apt-get update --no-install-recommends && \
    apt-get install -y git wget gnupg npm python3-dev libxml2-dev libxslt1-dev libldap2-dev \
    libsasl2-dev libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev libfreetype6-dev \
    liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev libxcb1-dev libpq-dev curl sudo \
    fontconfig libxrender1 xfonts-75dpi  xfonts-base python3-pypdf2  --no-install-recommends 
RUN   npm install -g rtlcss --registry=https://registry.npm.taobao.org
ADD http://file.rongbiz.cn/odoo/wkhtmltox_0.12.5-1.bionic_amd64.deb  /root/wkhtmltox_0.12.5-1.bionic_amd64.deb
ADD http://file.rongbiz.cn/odoo/pgdg.list  /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc |apt-key add - && apt-get install  libxext6 -y && \
    dpkg -i /root/wkhtmltox_0.12.5-1.bionic_amd64.deb &&  rm -rf /root/wkhtmltox_0.12.5-1.bionic_amd64.deb && \
   apt-get update && apt-get install -y fonts-wqy-zenhei fonts-wqy-microhei postgresql-client-12 --no-install-recommends
WORKDIR /root/
RUN apt-get install python3-pip -y
RUN  mkdir src local filestore bin configs logs  && \
     cd /root/src &&  git clone http://songbo:s180192000@gitlab.rongbiz.cn:3080/songbo/odoo14.git && cd odoo14 && \
     pip3 install -r  requirements.txt  -i  https://pypi.doubanio.com/simple/  || true 
RUN pip3 install simplejson -i "https://pypi.doubanio.com/simple/" && \
    pip3 install psycopg2-binary -i "https://pypi.doubanio.com/simple/" && \
    pip3 install setuptools  -i "https://pypi.doubanio.com/simple/" && \
    pip3 install pycryptodome -i "https://pypi.doubanio.com/simple/" && \
    pip3 install wheel  -i "https://pypi.doubanio.com/simple/" && \
    pip3 install rsa -i "https://pypi.doubanio.com/simple/"
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN cd /root/local && \
     git clone -b odoo14 http://songbo:s180192000@gitlab.rongbiz.cn:3080/c2p/extra_translation.git && ls /&& \
     git clone http://songbo:s180192000@gitlab.rongbiz.cn:3080/songbo/openc2p_erp_manager.git && \
     git clone -b 14 http://songbo:s180192000@gitlab.rongbiz.cn:3080/c2p/stock_mts_mto_rule.git && \
     git clone  http://songbo:s180192000@gitlab.rongbiz.cn:3080/songbo/web_enterprise_c2p.git && \
     git clone http://songbo:s180192000@gitlab.rongbiz.cn:3080/songbo/qqmap_widget.git && \
     git clone http://songbo:s180192000@gitlab.rongbiz.cn:3080/weixing/wx_attendance.git && \
     git clone http://songbo:s180192000@gitlab.rongbiz.cn:3080/yuzhengxing/wechat_base.git && \
     git clone http://songbo:s180192000@gitlab.rongbiz.cn:3080/yuzhengxing/work_weixin.git && \
     git clone -b branch http://songbo:s180192000@gitlab.rongbiz.cn:3080/yuzhengxing/wechat_public_server.git && \
     git clone http://songbo:s180192000@gitlab.rongbiz.cn:3080/yuzhengxing/wechat_public_server_ext.git && \
     git clone  -b 14 http://songbo:s180192000@gitlab.rongbiz.cn:3080/songbo/approvals_sequence.git && \
     git clone http://songbo:s180192000@gitlab.rongbiz.cn:3080/songbo/database_activation_code.git && \
     git clone http://songbo:s180192000@gitlab.rongbiz.cn:3080/songbo/c2p_watermark.git && \
     git clone http://songbo:s180192000@gitlab.rongbiz.cn:3080/yuzhengxing/home_page_icon.git 
EXPOSE 8069
EXPOSE 8072 
CMD ["/entrypoint.sh"]

entrypoint.sh

#!/bin/bash
cat >/root/configs/${DEMON:-rongbiz}.conf<<EOF
[options]
addons_path = /root/src/odoo14/odoo/addons,/root/local
admin_passwd = LMYfVpXLMfDLBWTG
csv_internal_sep = ,
data_dir = /root/filestore
db_host = ${DB_HOST:-False}
db_maxconn = 64
db_name = False
db_password = ${DB_PASSWORD:-rongbiz}
db_port = False
db_sslmode = prefer
db_template = template1
db_user = ${DEMON:-rongbiz}
dbfilter = False
demo = {}
email_from = False
geoip_database = /usr/share/GeoIP/GeoLite2-City.mmdb
http_enable = True
http_interface =
http_port = 8069
import_partial =
limit_memory_hard = 2684354560
limit_memory_soft = 2147483648
limit_request = 8192
limit_time_cpu = 300
limit_time_real = 600
limit_time_real_cron = -1
list_db = True
log_db = False
log_db_level = warning
log_handler = :INFO
log_level = info
logfile = /data/logs/${DEMON:-rongbiz}.log
longpolling_port = 8072
max_cron_threads = 2
osv_memory_age_limit = 1.0
osv_memory_count_limit = False
pg_path =
pidfile =
proxy_mode = True
reportgz = False
screencasts =
screenshots = /tmp/${DEMON:-rongbiz}
server_wide_modules = base,web
smtp_password = False
smtp_port = 25
smtp_server = localhost
smtp_ssl = False
smtp_user = False
syslog = False
test_enable = False
test_file =
test_tags = None
translate_modules = ['all']
unaccent = Falseupgrade_path =
without_demo = False
workers = ${WORKERS:-2}
EOF

if [ -a /data/src/odoo14/odoo-bin ];then
  rm -rf /data/*
  mv /root/* /data
  PYTHON=/usr/bin/python3
  ODOO=/data/src/odoo14/odoo-bin
  CONF=/data/configs/*.conf
  ${PYTHON} ${ODOO} -c ${CONF} "$@" 
else
    mkdir /data/
    mv /root/* /data
    PYTHON=/usr/bin/python3
    ODOO=/data/src/odoo14/odoo-bin
    CONF=/data/configs/${DEMON:-rongbiz}.conf
    ${PYTHON} ${ODOO} -c ${CONF} "$@"  && tail -f /root/logs/${DEMON:-rongbiz}.log
fi

docker-compose.yml

version: '2'
services:
  web:
    build: .
    depends_on:
      - mydb
    ports:
      - "8069:8069"
      - "8072:8072"
    environment:
    - DB_HOST=mydb
    - DEMON=odoo
    - DB_PASSWORD=myodoo
    volumes:
    - /data/odoo:/data
  mydb:
    image: postgres:12
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_PASSWORD=myodoo
      - POSTGRES_USER=odoo
posted @ 2021-07-13 20:08  老夫聊发少年狂88  阅读(227)  评论(0编辑  收藏  举报