Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. # Set the base image to Ubuntu
  2. FROM ubuntu:16.04
  3.  
  4. # Install tools and depedencies
  5. RUN apt-get update && apt-get install -y \
  6. curl \
  7. git \
  8. # mysql-server \
  9. # mysql-client \
  10. nano \
  11. net-tools \
  12. nginx \
  13. openssh-server \
  14. wget
  15.  
  16. # Add Prosody IM to the repository sources list and add package verification key
  17. RUN echo 'deb http://packages.prosody.im/debian xenial main' | tee /etc/apt/sources.list.d/prosody.list \
  18. && wget https://prosody.im/files/prosody-debian-packages.key -O- | apt-key add -
  19.  
  20. # Update the repository sources list once more and install Prosody package from SVN trunk
  21. RUN apt-get update -y && apt-get install -y \
  22. lua-bitop \
  23. lua-dbi-mysql \
  24. prosody-trunk \
  25. mercurial
  26.  
  27. # Initialise Prosody modules repository, load modules to opt directory, grant access to user prosody
  28. RUN hg clone https://hg.prosody.im/prosody-modules/ /opt/prosody-modules \
  29. && chgrp -R prosody /opt/prosody-modules && chmod -R 770 /opt/prosody-modules
  30.  
  31. # Add OTR community module
  32. RUN git clone https://github.com/dgoulet/prosody-otr.git /opt/prosody-modules/mod_otr
  33.  
  34. # Start Prosody service
  35. RUN prosodyctl start
  36.  
  37. ################## BEGIN CONFIGURATION ######################
  38.  
  39. # Backup and clean the default Prosody configuration file
  40. RUN cp /etc/prosody/prosody.cfg.lua /etc/prosody/prosody.cfg.lua.bak # \\
  41. # && > /etc/prosody/prosody.cfg.lua
  42.  
  43. # Writing configuration in Prosody config file
  44. RUN sed -ni '$ -- Prosody XMPP Server configuration \
  45. -- prosodyctl check config \
  46. \
  47. ---------- Server-wide settings ---------- \
  48. -- Settings in this section apply to the whole server and are the default settings \
  49. -- for any virtual hosts \
  50. admins = { "admin@localhost" } \
  51. daemonize = true \
  52. pidfile = "/var/run/prosody/prosody.pid" \
  53. \
  54. plugin_paths = { "/opt/prosody-modules" } \
  55. modules_enabled = { \
  56. "roster"; \
  57. "saslauth"; \
  58. "tls"; \
  59. "dialback"; \
  60. "disco"; \
  61. "private"; \
  62. "vcard"; \
  63. "blocklist"; \
  64. -- "smacks3"; \
  65. -- "smacks2"; \
  66. "carbons"; \
  67. "mam"; \
  68. "offline"; \
  69. "version"; \
  70. "register"; \
  71. "uptime"; \
  72. "time"; \
  73. "ping"; \
  74. "pep"; \
  75. "posix"; \
  76. "bosh"; \
  77. "websocket"; \
  78. "http"; \
  79. --"s2s"; \
  80. } \
  81. \
  82. modules_disabled = { \
  83. } \
  84. \
  85. allow_registration = false \
  86. authentication = "internal_hashed" \
  87. \
  88. ssl = { \
  89. key = "/var/lib/prosody/localhost.key"; \
  90. certificate = "/var/lib/prosody/localhost.crt"; \
  91. password = "Pa$$w0rd"; \
  92. } \
  93. \
  94. c2s_require_encryption = true \
  95. s2s_secure_auth = true \
  96. \
  97. cross_domain_bosh = true \
  98. consider_bosh_secure = true \
  99. \
  100. cross_domain_websocket = true \
  101. consider_websocket_secure = true \
  102. \
  103. storage = "sql" \
  104. sql = { \
  105. driver = "MySQL", \
  106. database = "prosody", \
  107. host = "localhost", \
  108. port = 3306, \
  109. username = "prosody", \
  110. password = "topsecret", \
  111. } \
  112. \
  113. -- Logging configuration \
  114. -- For advanced logging see https://prosody.im/doc/logging \
  115. log = { \
  116. info = "/var/log/prosody/prosody.log"; \
  117. error = "/var/log/prosody/prosody.error"; \
  118. } \
  119. \
  120. ----------- Virtual hosts ----------- \
  121. -- You need to add a VirtualHost entry for each domain you wish Prosody to serve. \
  122. -- Settings under each VirtualHost entry apply *only* to that host. \
  123. \
  124. VirtualHost "10.211.55.8" \
  125. -- VirtualHost "localhost" \
  126. \
  127. VirtualHost "anon.localhost" \
  128. enabled = false -- Remove this line to enable this host \
  129. \
  130. -- Assign this host a certificate for TLS, otherwise it would use the one \
  131. -- set in the global section (if any). \
  132. -- Note that old-style SSL on port 5223 only supports one certificate, and will always \
  133. -- use the global one. \
  134. -- ssl = { \
  135. key = "/var/lib/localhost.key"; \
  136. certificate = "/var/lib/localhost.crt"; \
  137. -- } \
  138. \
  139. ------ Components ------ \
  140. -- Component "muc.localhost" "muc" \
  141. \
  142. ' /etc/prosody/prosody.cfg.lua
  143.  
  144. # Check configuration file
  145. RUN cat /etc/prosody/prosody.cfg.lua
  146.  
  147. # RUN mysql_secure_installation
  148.  
  149. # Restart Prosody service
  150. RUN prosodyctl restart
  151.  
  152. # Expose the default port
  153. EXPOSE 80 443 3306 5222 5269 5347 5280 5281
  154.  
  155. # Default port to execute the entrypoint (BOSH/WebSockets)
  156. # CMD ["--port 5280"]
  157.  
  158. ################## END CONFIGURATION ######################
  159.  
  160. # Set default container command
  161. # ENTRYPOINT /etc/prosody/
  162. # ENTRYPOINT /var/log/prosody
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement