Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 82e59c9091 | |||
| 2b420fa628 | |||
| 9cbebe220d | |||
| ef57949ed1 | |||
| b0f191cbd3 | |||
| f84c37d808 | |||
| da004da054 | |||
| 7f9f2ca6ab | |||
| d429b2ca59 | |||
| 8c69d7f200 | |||
| 6629d6cf75 | |||
| 1b1f0ed951 |
+27
-18
@@ -7,24 +7,33 @@ FROM ubuntu:14.04
|
||||
|
||||
MAINTAINER Lloyd Watkin <lloyd@evilprofessor.co.uk>
|
||||
|
||||
RUN mkdir /data
|
||||
WORKDIR /data
|
||||
# Install dependencies
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||
libidn11 \
|
||||
liblua5.1-expat0 \
|
||||
libssl1.0.0 \
|
||||
lua-dbi-mysql \
|
||||
lua-dbi-postgresql \
|
||||
lua-dbi-sqlite3 \
|
||||
lua-event \
|
||||
lua-expat \
|
||||
lua-filesystem \
|
||||
lua-sec \
|
||||
lua-socket \
|
||||
lua-zlib \
|
||||
lua5.1 \
|
||||
openssl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get upgrade -y
|
||||
RUN apt-get install -y openssl lua5.1 lua-expat lua-socket lua-filesystem \
|
||||
libidn11 lua-event lua-zlib lua-dbi-mysql lua-dbi-postgresql \
|
||||
lua-dbi-sqlite3 libssl1.0.0 lua-sec lua-zlib liblua5.1-expat0
|
||||
# Install and configure prosody
|
||||
COPY ./prosody.deb /tmp/prosody.deb
|
||||
RUN dpkg -i /tmp/prosody.deb \
|
||||
&& sed -i '1s/^/daemonize = false;\n/' /etc/prosody/prosody.cfg.lua \
|
||||
&& perl -i -pe 'BEGIN{undef $/;} s/^log = {.*?^}$/log = {\n {levels = {min = "info"}, to = "console"};\n}/smg' /etc/prosody/prosody.cfg.lua
|
||||
|
||||
COPY ./prosody.deb /data/prosody.deb
|
||||
COPY ./start.sh /data/start.sh
|
||||
COPY ./entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
RUN chmod 700 /data/start.sh
|
||||
RUN dpkg -i /data/prosody.deb
|
||||
|
||||
# If using default configuration keep a process alive
|
||||
RUN echo 'daemonize = false;' | cat - /etc/prosody/prosody.cfg.lua > temp && mv temp /etc/prosody/prosody.cfg.lua
|
||||
|
||||
EXPOSE 443 80 5222 5269 5347 5280 5281
|
||||
|
||||
ENTRYPOINT /data/start.sh
|
||||
EXPOSE 80 443 5222 5269 5347 5280 5281
|
||||
CMD ["prosodyctl", "start"]
|
||||
|
||||
@@ -6,18 +6,18 @@ For images please see here: [Prosody on Docker](https://registry.hub.docker.com/
|
||||
|
||||
It works by coping in a recently built `deb` file and running the install on the system.
|
||||
|
||||
## Running
|
||||
## Running
|
||||
|
||||
Docker images are built off an __Ubuntu 14.04 LTS__ base.
|
||||
|
||||
```bash
|
||||
docker run -d prosody/prosody --name prosody -p 5222:5222
|
||||
docker run -d --name prosody -p 5222:5222 prosody/prosody
|
||||
```
|
||||
|
||||
On startup the image will create a default user of `admin@localhost` with password `password`. This can be changed by using environment variables `LOCAL`, `DOMAIN`, and `PASSWORD`. This performs the following action on startup:
|
||||
A user can be created by using environment variables `LOCAL`, `DOMAIN`, and `PASSWORD`. This performs the following action on startup:
|
||||
|
||||
prosodyctl register *local* *domain* *password*
|
||||
|
||||
|
||||
Any error from this script is ignored. Prosody will not check the user exists before running the command (i.e. existing users will be overwritten). It is expected that [mod_admin_adhoc](http://prosody.im/doc/modules/mod_admin_adhoc) will then be in place for managing users (and the server).
|
||||
|
||||
### Ports
|
||||
@@ -43,6 +43,7 @@ Volumes can be mounted at the following locations for adding in files:
|
||||
* __/var/log/prosody__:
|
||||
* Log files for prosody - if not mounted these will be stored on the system
|
||||
* Note: This location can be changed in the configuration, update to match
|
||||
* Also note: The log directory on the host (/logs/prosody in the example below) must be writeable by the prosody user
|
||||
* __/usr/lib/prosody-modules__ (suggested):
|
||||
* Location for including additional modules
|
||||
* Note: This needs to be included in your config file, see http://prosody.im/doc/installing_modules#paths
|
||||
@@ -50,16 +51,17 @@ Volumes can be mounted at the following locations for adding in files:
|
||||
### Example
|
||||
|
||||
```
|
||||
docker run -d prosody/prosody:0.9 \
|
||||
docker run -d \
|
||||
-p 5222:5222 \
|
||||
-p 5269:5269 \
|
||||
-p localhost:5347:5347 \
|
||||
-e LOCAL=romeo \
|
||||
-e DOMAIN=shakespeare.lit \
|
||||
-e PASSWORD=juliet4ever \
|
||||
-v /etc/prosody /data/prosody/configuration \
|
||||
-v /var/log/prosody /logs/prosody \
|
||||
-v /usr/lib/prosody-modules /data/prosody/modules
|
||||
-v /data/prosody/configuration:/etc/prosody \
|
||||
-v /logs/prosody:/var/log/prosody \
|
||||
-v /data/prosody/modules:/usr/lib/prosody-modules \
|
||||
prosody/prosody:0.9
|
||||
```
|
||||
|
||||
## Building
|
||||
@@ -70,7 +72,7 @@ Use the `build-docker.sh` script as follows:
|
||||
./build-docker.sh /path/to/built-image.deb version_tag [, ...version_tag2, ...]
|
||||
```
|
||||
|
||||
Where argument 1 is a pointer to the build `deb` file that you'd like to make an image from and 'version_tag' is the tag you'd like to push to the Docker registry with.
|
||||
Where argument 1 is a pointer to the build `deb` file that you'd like to make an image from and 'version_tag' is the tag you'd like to push to the Docker registry with.
|
||||
|
||||
You can specify multiple tags by adding additional tag names to the end of the command. This is useful where a for example release 0.10.4 is made which also consitutes 'latest', '0.10-nightly', '0.10.4', '0.10' images.
|
||||
|
||||
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [ "$LOCAL" -a "$PASSWORD" -a "$DOMAIN" ] ; then
|
||||
prosodyctl register $LOCAL $DOMAIN $PASSWORD
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user