You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
3.0 KiB

  1. docker-image: docker.0k.io/mirror/odoo:rc_12.0-MYC-INIT-3.7
  2. data-resources:
  3. - /var/lib/odoo
  4. # config-resources:
  5. # ## XXXvlab: should this be there or declared dynamically in the relation that
  6. # ## create/update this file ?
  7. # # - /etc/odoo-server.conf
  8. charm-resources:
  9. - /opt/odoo/common/entrypoint.d/20-postgres-wait
  10. docker-compose:
  11. command:
  12. - odoo
  13. - --config=/opt/odoo/auto/odoo.conf
  14. ## YYYvlab: useful ?
  15. tty: true
  16. environment:
  17. INITIAL_LANG: fr_FR
  18. LIST_DB: 'true'
  19. default-options:
  20. workers: 1
  21. # modules:
  22. # - l10n_fr
  23. #database: MYDATABASE ## will be the one connected to postgres
  24. ## Adds custom values in options
  25. # conf:
  26. # options:
  27. # email_from: xxxx
  28. # othersection:
  29. # myvalue: yyy
  30. provides:
  31. odoo-server:
  32. uses:
  33. postgres-database:
  34. #constraint: required | recommended | optional
  35. #auto: pair | summon | none ## default: pair
  36. constraint: required
  37. auto: summon
  38. solves:
  39. database: "main storage"
  40. default-options:
  41. extensions:
  42. - unaccent
  43. log-rotate:
  44. #constraint: required | recommended | optional
  45. #auto: pair | summon | none ## default: pair
  46. constraint: recommended
  47. auto: pair
  48. solves:
  49. unmanaged-logs: "in docker logs"
  50. #default-options:
  51. web-proxy:
  52. #constraint: required | recommended | optional
  53. #auto: pair | summon | none ## default: pair
  54. constraint: recommended
  55. auto: pair
  56. solves:
  57. proxy: "Public access"
  58. default-options:
  59. target: !var-expand ${MASTER_BASE_SERVICE_NAME}:8069
  60. apache-custom-rules:
  61. - !bash-stdout |
  62. workers=$(relation-base-compose-get workers 2>/dev/null)
  63. workers=${workers:-1}
  64. version=$(cached_cmd_on_base_image "$MASTER_BASE_SERVICE_NAME" \
  65. "python -c 'import odoo; print(odoo.cli.server.__version__)'") || exit 1
  66. if [ "$workers" -gt 1 ]; then
  67. if [ "${version%.*}" -lt 16 ]; then
  68. echo "ProxyPass /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/"
  69. echo "ProxyPassReverse /longpolling/ http://${MASTER_BASE_SERVICE_NAME}:8072/longpolling/"
  70. else
  71. echo "ProxyPass /websocket ws://${MASTER_BASE_SERVICE_NAME}:8072/websocket"
  72. echo "ProxyPassReverse /websocket ws://${MASTER_BASE_SERVICE_NAME}:8072/websocket"
  73. fi
  74. fi
  75. backup:
  76. constraint: recommended
  77. auto: pair
  78. solves:
  79. backup: "Automatic regular backup"
  80. default-options:
  81. ## First pattern matching wins, no pattern matching includes.
  82. ## include-patterns are checked first, then exclude-patterns
  83. ## Patterns rules:
  84. ## - ending / for directory
  85. ## - '*' authorized
  86. ## - must start with a '/', will start from $SERVICE_DATASTORE
  87. exclude-patterns:
  88. - "/var/lib/odoo/sessions/"
  89. # network-isolation:
  90. # whitelist: ## required external services used by this service
  91. # - www.google.com
  92. # - www.gravatar.com
  93. # - fonts.gstatic.com
  94. # - fonts.googleapis.com
  95. # - cdnjs.cloudflare.com