Skip to content

Instantly share code, notes, and snippets.

@nqb
Last active March 4, 2021 19:57
Show Gist options
  • Save nqb/2d030e8d09c5374a0d88c53b65e74d5e to your computer and use it in GitHub Desktop.
Save nqb/2d030e8d09c5374a0d88c53b65e74d5e to your computer and use it in GitHub Desktop.
version: "2.1"
services:
odoo:
build:
context: ./odoo
image: filament/odoo:14.0
container_name: odoo
depends_on:
- db
- smtp
environment:
PGDATABASE: "odoo_db"
tty: true
volumes:
- filestore:/opt/odoo/data:z
networks:
default:
inverseproxy_shared:
whitelists_proxy:
email_proxy:
restart: unless-stopped
labels:
co.elastic.logs/multiline.pattern: '^[0-9]{2}'
co.elastic.logs/multiline.negate: 'true'
co.elastic.logs/multiline.match: "after"
traefik.enable: "true"
traefik.http.routers.odoo-restrict.middlewares: "auth@file"
traefik.http.routers.odoo-restrict.rule: "Host(`www.example.fr`) && Path(`/website/info`, `/web/database/{p:manager|create|duplicate|drop|backup|restore|change_password}`)"
traefik.http.routers.odoo-restrict.service: "odoo"
traefik.http.routers.odoo.rule: "Host(`www.example.fr`)"
traefik.http.routers.odoo.service: "odoo"
traefik.http.services.odoo.loadbalancer.server.port: "8069"
db:
image: postgres:13-alpine
container_name: odoo_db
environment:
POSTGRES_USER: "odoo"
POSTGRES_PASSWORD: "secret"
labels:
co.elastic.logs/module: postgresql
volumes:
- db:/var/lib/postgresql/data:z
restart: unless-stopped
smtp:
image: tecnativa/postfix-relay
container_name: odoo_smtp
networks:
email_proxy:
volumes:
- smtp:/var/spool/postfix
environment:
MAILNAME: "example.fr"
MAIL_RELAY_HOST: "example.fr"
MAIL_RELAY_PORT: "587"
MAIL_RELAY_USER: "odoo"
MAIL_RELAY_PASS: "secret"
MAIL_CANONICAL_DOMAINS: "example.fr"
MAIL_NON_CANONICAL_DEFAULT: "example.fr"
restart: unless-stopped
networks:
default:
internal: true
driver_opts:
encrypted: 1
inverseproxy_shared:
external: true
whitelists_proxy:
external: true
email_proxy:
driver_opts:
encrypted: 1
internal: true
email_public:
driver_opts:
encrypted: 1
volumes:
filestore:
db:
smtp:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment