fork 0k-charms
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.

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