docker-entrypoint.sh 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/bash
  2. set -e
  3. # set -x
  4. cat >/home/torquebox/oadr/config/database.yml <<EOF
  5. production:
  6. adapter: jdbcpostgresql
  7. database: ${RAILS_DB_DATABASE}
  8. username: ${RAILS_DB_USERNAME}
  9. password: ${RAILS_DB_PASSWORD}
  10. host: ${RAILS_DB_HOSTNAME}
  11. pool: 20
  12. EOF
  13. cat >/home/torquebox/oadr/config/initializers/secret_token.rb <<EOF
  14. Oadr::Application.config.secret_token = '${RAILS_SECRET_TOKEN}'
  15. EOF
  16. cat >/home/torquebox/oadr/config/torquebox.yml <<'EOF'
  17. # This is the TorqueBox configuration file. Refer to the TorqueBox
  18. # documentation at http://torquebox.org/documentation/current/
  19. # for all configuration options.
  20. web:
  21. context: "/"
  22. services:
  23. push_message_manager:
  24. service: PushMessageManager
  25. config:
  26. enableXmpp: false
  27. host: # set the XMPP hostname. This name must match the hostname field configured in the XMPP server
  28. port: 5222
  29. username: 222222222222
  30. password: password
  31. keystore: keystore.jks
  32. keystorePassword: password
  33. truststore: truststore.jks
  34. truststorePassword: password
  35. protocols: TLSv1.2,TLSv1
  36. cipherSuites: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_128_CBC_SHA
  37. enableTLS: fals
  38. tlsDebug: true
  39. validateVENHostname: false
  40. advance_objects:
  41. service: AdvanceObjects
  42. config:
  43. sleep: 10
  44. jobs:
  45. generate_tou_events:
  46. job: GenerateTouEvents
  47. # second, minute, hour, day_of_month, month, day_of_week, year(optional)
  48. # Either day_of_month or day_of_week must be set to '?', as Torquebox does not support using both at once
  49. # here's a discussion on ? vs *: http://stackoverflow.com/questions/11499740/significance-of-question-mark-in-java-cron
  50. # the example below runs every Friday, making it invalid to say * for day of month (day of month is dependent on
  51. # day of week which is Friday)
  52. cron: '0 0 12 ? * FRI *'
  53. # cron: '0 */1 * * * ?' # UNCOMMENT FOR TESTING run every 1 minute
  54. timeout: 120 s
  55. description: Create Event instances (and associated signal-related objects) based on TouSchedule
  56. EOF
  57. if [[ "$1" == "initdb" ]]; then
  58. echo "initializing database"
  59. /docker-initdb.sh
  60. fi
  61. if [[ "$1" == "run" ]]; then
  62. echo "executing rails"
  63. /docker-run.sh
  64. fi