version: '2'
services:
  web:
    container_name: odoo-web
    image: odoo:13
    restart: always
    depends_on:
      - db
    ports:
      - "8070:8069"
    environment:
      - HOST=db
      - PORT=5432
      - POSTGRES_DB=postgres
      - POSTGRES_USER=aierp
      - POSTGRES_PASSWORD=aierppwd
    volumes:
      - odoo-web-data:/var/lib/odoo
      - ./config:/etc/odoo
      - ./addonX:/mnt/extra-addons
      - ./addons:/mnt/addons
  db:
    container_name: odoo-db
    image: postgres:9.6.22
    restart: always
    ports:
      - "5433:5432"
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=your user
      - POSTGRES_PASSWORD=your password
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - odoo-db-data:/var/lib/postgresql/data/pgdata
volumes:
  odoo-web-data:
  odoo-db-data:

//POSTGRES_DB=postgres 这个不能修改,不然会无法初始化odoo