Skip to content

Commit

Permalink
[IMP] Remove 1 proxy from stack
Browse files Browse the repository at this point in the history
Thanks to Traefik 1.3 now we can use only traefik for separating normal
Odoo requests from longpolling ones.

See traefik/traefik#1257.
  • Loading branch information
yajo committed Jun 6, 2017
1 parent 93166d0 commit eee1655
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 42 deletions.
23 changes: 6 additions & 17 deletions common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ services:
tty: true
volumes:
- filestore$ODOO_MAJOR:/var/lib/odoo
networks:
default:
aliases:
# For `https` service
- www
labels:
traefik.docker.network: "inverseproxy_shared"
traefik.enable: "true"
traefik.frontend.passHostHeader: "true"
traefik.longpolling.port: "8072"
traefik.www.port: "8069"

db:
image: postgres:${DB_VERSION}-alpine
Expand All @@ -23,18 +24,6 @@ services:
volumes:
- db$ODOO_MAJOR:/var/lib/postgresql/data

# TODO Remove this when Traefik 1.3 is released
# SEE /~https://github.com/containous/traefik/pull/1257
proxy:
image: tecnativa/odoo-proxy
environment:
FORWARDFOR: 0
labels:
traefik.docker.network: "inverseproxy_shared"
traefik.enable: "true"
traefik.frontend.passHostHeader: "true"
traefik.port: "80"

smtpfake:
image: tecnativa/smtp-sink

Expand Down
20 changes: 7 additions & 13 deletions prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,20 @@ services:
- db
- smtp
- inbox
networks:
default:
inverseproxy_shared:
labels:
traefik.longpolling.frontend.rule:
"Host:${DOMAIN_PROD};PathPrefix:/longpolling/"
traefik.www.frontend.rule: "Host:${DOMAIN_PROD}"

db:
extends:
file: common.yaml
service: db
restart: unless-stopped

proxy:
extends:
file: common.yaml
service: proxy
restart: unless-stopped
networks:
default:
inverseproxy_shared:
environment:
FORCEHOST: $DOMAIN_PROD
labels:
traefik.frontend.rule: "Host:${DOMAIN_PROD}"

inbox:
extends:
file: common.yaml
Expand Down
19 changes: 7 additions & 12 deletions test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ services:
- db
- smtp
- inbox
networks:
default:
inverseproxy_shared:
labels:
traefik.longpolling.frontend.rule:
"Host:${DOMAIN_TEST};PathPrefix:/longpolling/"
traefik.www.frontend.rule: "Host:${DOMAIN_TEST}"
command:
- odoo
- --workers=2
Expand All @@ -23,18 +30,6 @@ services:
file: common.yaml
service: db

proxy:
extends:
file: common.yaml
service: proxy
networks:
default:
inverseproxy_shared:
environment:
FORCEHOST: $DOMAIN_TEST
labels:
traefik.frontend.rule: "Host:${DOMAIN_TEST}"

inbox:
extends:
file: common.yaml
Expand Down

0 comments on commit eee1655

Please sign in to comment.