provisioning tool for building opinionated architecture
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.

68 lines
2.3 KiB

  1. ---
  2. templates:
  3. - "templates/web.template.yml"
  4. - "templates/web.ratelimited.template.yml"
  5. expose:
  6. - "{{ env.APP_PORT }}:80"
  7. params:
  8. ## Which Git revision should this container use? (default: tests-passed)
  9. #version: tests-passed
  10. version: latest-release #FIXME: does it work?
  11. env:
  12. DISCOURSE_HOSTNAME: '{{ env.APP_FQDN }}'
  13. LC_ALL: en_US.UTF-8
  14. LANG: en_US.UTF-8
  15. LANGUAGE: en_US.UTF-8
  16. # DISCOURSE_DEFAULT_LOCALE: en
  17. ## Uncomment if you want the container to be started with the same
  18. ## hostname (-h option) as specified above (default "$hostname-$config")
  19. DOCKER_USE_HOSTNAME: true
  20. DISCOURSE_SMTP_ADDRESS: {{ services[env.APP_DOMAIN][env.APP_SUBDOMAIN].data.discourse.smtp.server }}
  21. DISCOURSE_SMTP_PORT: {{ services[env.APP_DOMAIN][env.APP_SUBDOMAIN].data.discourse.smtp.port }}
  22. DISCOURSE_SMTP_USER_NAME: {{ services[env.APP_DOMAIN][env.APP_SUBDOMAIN].data.discourse.smtp.username }}
  23. DISCOURSE_SMTP_PASSWORD: {{ services[env.APP_DOMAIN][env.APP_SUBDOMAIN].data.discourse.smtp.password }}
  24. DISCOURSE_DEVELOPER_EMAILS: {{ services[env.APP_DOMAIN][env.APP_SUBDOMAIN].data.discourse.admin }}
  25. DISCOURSE_NOTIFICATION_EMAIL: noreply@{{ env.APP_DOMAIN }}
  26. DISCOURSE_DB_NAME: {{ env.APP_NAME }}
  27. DISCOURSE_DB_USERNAME: {{ env.APP_NAME }}
  28. DISCOURSE_DB_PASSWORD: {{ env.APP_NAME }}
  29. DISCOURSE_DB_HOST: ct1.lxd
  30. DISCOURSE_REDIS_HOST: ct1.lxd
  31. volumes:
  32. - volume:
  33. host: /var/discourse/shared/web-only
  34. guest: /shared
  35. - volume:
  36. host: /var/discourse/shared/web-only/log/var-log
  37. guest: /var/log
  38. ## Plugins go here
  39. ## see https://meta.discourse.org/t/19157 for details
  40. hooks:
  41. after_code:
  42. - exec:
  43. cd: $home/plugins
  44. cmd:
  45. - git clone https://github.com/discourse/docker_manager.git
  46. {%- if services[env.APP_DOMAIN][env.APP_SUBDOMAIN]['data']['discourse']['plugins'] %}
  47. {%- for plugin in services[env.APP_DOMAIN][env.APP_SUBDOMAIN]['data']['discourse']['plugins'] %}
  48. - git clone {{ plugin }}
  49. {%- endfor %}
  50. {%- endif %}
  51. ## Remember, this is YAML syntax - you can only have one block with a name
  52. run:
  53. - exec: echo "Beginning of custom commands"
  54. - exec: echo "End of custom commands"
  55. - exec: awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'