captainVersion: 4
networks:
    db:
        driver: bridge
    search:
        driver: bridge
services:
    $$cap_appname-db:
        image: postgres:$$cap_postgres_version
        volumes:
            - $$cap_appname-db-data:/var/lib/postgresql/data
        restart: always
        environment:
            POSTGRES_USER: odoo
            POSTGRES_PASSWORD: $$cap_postgres_password
            POSTGRES_DB: postgres
        caproverExtra:
            notExposeAsWebApp: 'true'
    $$cap_appname:
        image: odoo:$$cap_odoo_version
        depends_on:
            - $$cap_appname-db
        volumes:
            - $$cap_appname-odoo-web-data:/var/lib/odoo
            - $$cap_appname-config:/etc/odoo
            - $$cap_appname-addons:/mnt/extra-addons
        restart: always
        environment:
            POSTGRES_PASSWORD: $$cap_postgres_password
            HOST: srv-captain--$$cap_appname-db
        caproverExtra:
            containerHttpPort: '8069'
caproverOneClickApp:
    variables:
        - id: $$cap_postgres_version
          label: Postgres Version
          defaultValue: 9.6.18-alpine
          description: Checkout their docker page for the valid tags https://hub.docker.com/r/library/postgres/tags/
          validRegex: /^([^\s^\/])+$/
        - id: $$cap_postgres_password
          label: Postgres Password
          description: ''
          validRegex: /.{1,}/
        - id: $$cap_odoo_version
          label: Odoo Version
          defaultValue: '13.0'
          description: Checkout their docker page for the valid tags https://hub.docker.com/_/odoo?tab=tags
          validRegex: /^([^\s^\/])+$/
    instructions:
        start: Odoo is an open source product CRM
        end: Odoo is deployed and the dashboard is available from http://$$cap_appname.$$cap_root_domain.
    isOfficial: true
    description: Odoo, formerly known as OpenERP, is a suite of open-source business apps written in Python and released under the AGPL license.
    documentation: https://hub.docker.com/_/odoo?tab=description
