透過 docker 快速安裝 odoo
  • 4,374 views,
  • 2018-12-28,
  • 上傳者: Kuann Hung,
  •  0
0c9381d23afe089c35db175dc72bf8a6.png
步驟
1.
安裝 Docker
yum -y install docker
啟用並啟動 docker
systemctl enable docker
systemctl start docker
2.
安裝 postgress
由於 odoo 是使用 postgress 資料庫,所以就先用 docker 安裝 postgress 吧!
docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:10
3.
安裝 odoo
docker run -p 8069:8069 --name odoo --link db:db -t odoo
4.
備份方式
docker save odoo | gzip > odoo.gz
docker save db | gzip > db.gz
5.
還原
docker load < db.gz
docker load < odoo.gz
6.
前端採用 nginx 作為反向代理
先建立 cache 目錄
mkdir -p /var/nginx/cache
chown -R nginx. /var/nginx/cache
  • /etc/nginx/nginx.conf
user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;

events {
    worker_connections  1024;
}

http {

    proxy_cache_path  /var/nginx/cache  levels=1:2    keys_zone=STATIC:10m
                                         inactive=24h  max_size=1g;

    client_max_body_size 10G;
    sendfile        on;
    tcp_nopush     on;

    keepalive_timeout  600;
    tcp_nodelay        on;

    upstream backend {
        server localhost:8069;
    }

    upstream ssl_backend {
        server localhost:8069;
    }

    server {
        gzip on;
        gzip_min_length 1k;
        gzip_buffers 4 16k;
        #gzip_http_version 1.0;
        gzip_comp_level 2;
        gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php;
        gzip_vary off;
        gzip_disable "MSIE [1-6]\.";
    }

    include /etc/nginx/conf.d/*.conf;
}
  • /etc/nginx/conf.d/ssl.conf
server {
    # if you wanna to enable HTTP/2 (need nginx 1.9.5+)
    listen              443 ssl http2;
    listen              [::]:443 ssl http2;

    server_name         example.com;
    ssl_certificate     /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;


    ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers         HIGH:!aNULL:!MD5;
    location / {
        add_header X-Proxy-Cache    $upstream_cache_status;
        proxy_pass                  http://ssl_backend;
        proxy_set_header            Host $host;
        proxy_set_header            X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_cache_key             "$scheme$host$request_uri";
        proxy_cache                 STATIC;
        proxy_cache_valid           200  7d;
        proxy_cache_bypass  $http_cache_control;
        proxy_cache_use_stale       error timeout invalid_header updating
                                    http_500 http_502 http_503 http_504;

    }

}
Facebook 討論區載入中...
資料夾 :
發表時間 :
2018-12-28 23:48:00
觀看數 :
4,374
發表人 :
Kuann Hung
部門 :
老洪的 IT 學習系統
QR Code :