安裝 Docker
yum -y install docker
啟用並啟動 docker
systemctl enable docker systemctl start docker
yum -y install docker
systemctl enable docker systemctl start docker
docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres --name db postgres:10
docker run -p 8069:8069 --name odoo --link db:db -t odoo
docker save odoo | gzip > odoo.gz docker save db | gzip > db.gz
docker load < db.gz docker load < odoo.gz
mkdir -p /var/nginx/cache chown -R nginx. /var/nginx/cache
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; }
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; } }