Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Set the base image to Ubuntu
- FROM ubuntu:16.04
- # Install tools and depedencies
- RUN apt-get update && apt-get install -y \
- curl \
- git \
- # mysql-server \
- # mysql-client \
- nano \
- net-tools \
- nginx \
- openssh-server \
- wget
- # Add Prosody IM to the repository sources list and add package verification key
- RUN echo 'deb http://packages.prosody.im/debian xenial main' | tee /etc/apt/sources.list.d/prosody.list \
- && wget https://prosody.im/files/prosody-debian-packages.key -O- | apt-key add -
- # Update the repository sources list once more and install Prosody package from SVN trunk
- RUN apt-get update -y && apt-get install -y \
- lua-bitop \
- lua-dbi-mysql \
- prosody-trunk \
- mercurial
- # Initialise Prosody modules repository, load modules to opt directory, grant access to user prosody
- RUN hg clone https://hg.prosody.im/prosody-modules/ /opt/prosody-modules \
- && chgrp -R prosody /opt/prosody-modules && chmod -R 770 /opt/prosody-modules
- # Add OTR community module
- RUN git clone https://github.com/dgoulet/prosody-otr.git /opt/prosody-modules/mod_otr
- # Start Prosody service
- RUN prosodyctl start
- ################## BEGIN CONFIGURATION ######################
- # Backup and clean the default Prosody configuration file
- RUN cp /etc/prosody/prosody.cfg.lua /etc/prosody/prosody.cfg.lua.bak # \\
- # && > /etc/prosody/prosody.cfg.lua
- # Writing configuration in Prosody config file
- RUN sed -ni '$ -- Prosody XMPP Server configuration \
- -- prosodyctl check config \
- \
- ---------- Server-wide settings ---------- \
- -- Settings in this section apply to the whole server and are the default settings \
- -- for any virtual hosts \
- admins = { "admin@localhost" } \
- daemonize = true \
- pidfile = "/var/run/prosody/prosody.pid" \
- \
- plugin_paths = { "/opt/prosody-modules" } \
- modules_enabled = { \
- "roster"; \
- "saslauth"; \
- "tls"; \
- "dialback"; \
- "disco"; \
- "private"; \
- "vcard"; \
- "blocklist"; \
- -- "smacks3"; \
- -- "smacks2"; \
- "carbons"; \
- "mam"; \
- "offline"; \
- "version"; \
- "register"; \
- "uptime"; \
- "time"; \
- "ping"; \
- "pep"; \
- "posix"; \
- "bosh"; \
- "websocket"; \
- "http"; \
- --"s2s"; \
- } \
- \
- modules_disabled = { \
- } \
- \
- allow_registration = false \
- authentication = "internal_hashed" \
- \
- ssl = { \
- key = "/var/lib/prosody/localhost.key"; \
- certificate = "/var/lib/prosody/localhost.crt"; \
- password = "Pa$$w0rd"; \
- } \
- \
- c2s_require_encryption = true \
- s2s_secure_auth = true \
- \
- cross_domain_bosh = true \
- consider_bosh_secure = true \
- \
- cross_domain_websocket = true \
- consider_websocket_secure = true \
- \
- storage = "sql" \
- sql = { \
- driver = "MySQL", \
- database = "prosody", \
- host = "localhost", \
- port = 3306, \
- username = "prosody", \
- password = "topsecret", \
- } \
- \
- -- Logging configuration \
- -- For advanced logging see https://prosody.im/doc/logging \
- log = { \
- info = "/var/log/prosody/prosody.log"; \
- error = "/var/log/prosody/prosody.error"; \
- } \
- \
- ----------- Virtual hosts ----------- \
- -- You need to add a VirtualHost entry for each domain you wish Prosody to serve. \
- -- Settings under each VirtualHost entry apply *only* to that host. \
- \
- VirtualHost "10.211.55.8" \
- -- VirtualHost "localhost" \
- \
- VirtualHost "anon.localhost" \
- enabled = false -- Remove this line to enable this host \
- \
- -- Assign this host a certificate for TLS, otherwise it would use the one \
- -- set in the global section (if any). \
- -- Note that old-style SSL on port 5223 only supports one certificate, and will always \
- -- use the global one. \
- -- ssl = { \
- key = "/var/lib/localhost.key"; \
- certificate = "/var/lib/localhost.crt"; \
- -- } \
- \
- ------ Components ------ \
- -- Component "muc.localhost" "muc" \
- \
- ' /etc/prosody/prosody.cfg.lua
- # Check configuration file
- RUN cat /etc/prosody/prosody.cfg.lua
- # RUN mysql_secure_installation
- # Restart Prosody service
- # RUN prosodyctl restart
- # Expose the default port
- EXPOSE 3306 5222 5269 5280
- # Default port to execute the entrypoint (BOSH/WebSockets)
- # CMD ["--port 5280"]
- ################## END CONFIGURATION ######################
- # Set default container command
- # ENTRYPOINT /etc/prosody/
- # ENTRYPOINT /var/log/prosody
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement