$ docker run -d -e POSTGRES_USER=odoo -e POSTGRES_PASSWORD=odoo --name x-db postgres:9.4
kemudian build 2 odoo nya
odoo 1
$ docker run -p 8069:8069 --name x-odoo-1 --link x-db:db -t repodev/qinota-install:dev
odoo 2
$ docker run -p 3344:8069 --name x-odoo-2 --link x-db:db -t repodev/qinota-install:dev
kemudian jalankan nginx nya, disini saya menggunakan nginx di local komputer saya, tidak menggunakan docker (next tutorial mungkin dibuatkan)
berikut configuration nginx nya
upstream app {
ip_hash;
server 172.17.0.4:8069 max_fails=3 fail_timeout=15s; # odoo 1
server 172.17.0.5:8069 max_fails=3 fail_timeout=15s; # odoo 2
}
upstream poll {
ip_hash;
server 172.17.0.4:8072; # odoo 1
server 172.17.0.5:8072; # odoo 2
}
server {
listen 80 default_server;
server_name localodoo.docker;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
#proxy_redirect http:// https://;
proxy_read_timeout 600s;
client_max_body_size 100m;
location /longpolling {
proxy_pass http://poll;
}
location / {
proxy_pass http://app;
# # time out settings
proxy_connect_timeout 159s;
# proxy_send_timeout 600;
proxy_read_timeout 155;
}
error_page 500 502 503 504 = @errorz;
location @errorz {
internal;
root /var/www/html/e;
try_files $uri /index.html = 500 502 503 504;
}
## fonts
location ~* \.(eot|ttf|woff)$ {
add_header Access-Control-Allow-Origin *;
}
}
untuk mengetahui ip dari docker container kita ketikan
$ docker inspect --format='{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq)
Sekian dan terimagaji kasih
Tambahkan Komentar