2018-11-22 20:01:37 +01:00
|
|
|
## Prosody Docker image
|
|
|
|
Source: https://bitbucket.org/elfrinjo/dockerfiles/src/master/prosody-0.11/
|
2017-12-09 16:46:17 +01:00
|
|
|
|
2018-11-22 18:15:06 +01:00
|
|
|
Create an image for running prosody XMPP server version 0.11
|
2017-12-09 16:46:17 +01:00
|
|
|
http://prosody.im/ on Alpine Linux.
|
|
|
|
|
|
|
|
HINT: This is not an official image. Builds might not happen regularly.
|
|
|
|
|
|
|
|
You will need to configure a vhost inside the config volume (prosody.cfg.lua).
|
|
|
|
|
|
|
|
The certificate generation with prosodyctl does not work.
|
2018-11-22 20:01:37 +01:00
|
|
|
However, certificates can be put into the config volume.
|
|
|
|
I suggest acme.sh for communication with Letsencrypt.
|
|
|
|
https://github.com/Neilpang/acme.sh/wiki/Run-acme.sh-in-docker
|
2017-12-09 16:46:17 +01:00
|
|
|
You need to configure the certificates location inside prosodys config.
|
|
|
|
|
|
|
|
IPORTANT: You really should add TLS.
|
|
|
|
|
2018-11-22 20:01:37 +01:00
|
|
|
## Upgrading from 0.10
|
|
|
|
The module configuration has to be updated:
|
|
|
|
- Replace mod_omemo_all_access with mod_profile
|
|
|
|
- Replace mod_mam_muc with mod_muc_mam
|
|
|
|
- Disable mod_omemo_all_access
|
2017-12-09 16:46:17 +01:00
|
|
|
|
2018-11-22 20:01:37 +01:00
|
|
|
## Usage
|
|
|
|
Start the container with volumes for config and database.
|
2017-12-09 16:46:17 +01:00
|
|
|
Do not forget to customize your configuration!
|
2018-11-22 20:01:37 +01:00
|
|
|
.
|
|
|
|
.
|
2017-12-09 16:46:17 +01:00
|
|
|
```console
|
2018-11-22 20:01:37 +01:00
|
|
|
# docker run -d \
|
2018-11-22 18:15:06 +01:00
|
|
|
-p 5000:5000 \
|
2017-12-09 16:46:17 +01:00
|
|
|
-p 5222:5222 \
|
|
|
|
-p 5269:5269 \
|
|
|
|
-p 5280:5280 \
|
|
|
|
-p 5281:5281 \
|
|
|
|
--restart always \
|
|
|
|
--name prosody \
|
|
|
|
-v /etc/localtime:/etc/localtime:ro \
|
|
|
|
-v prosody-cfg:/usr/local/etc/prosody:ro \
|
|
|
|
-v prosody-data:/usr/local/var/lib/prosody \
|
2018-11-22 20:01:37 +01:00
|
|
|
elfrinjo/prosody-0.11
|
2017-12-09 16:46:17 +01:00
|
|
|
```
|
2018-11-22 20:01:37 +01:00
|
|
|
.
|
|
|
|
.
|
2017-12-09 16:46:17 +01:00
|
|
|
To create the first user, exec into the running container and use prosodyctl.
|
|
|
|
```console
|
2018-11-22 20:01:37 +01:00
|
|
|
# docker exec -ti prosody bash
|
|
|
|
#/$ prosodyctl adduser JID
|
2017-12-09 16:46:17 +01:00
|
|
|
```
|
2018-11-22 20:01:37 +01:00
|
|
|
.
|
|
|
|
.
|
2017-12-09 16:46:17 +01:00
|
|
|
To Create a certificate for you host:
|
|
|
|
```console
|
2018-11-22 20:01:37 +01:00
|
|
|
# docker pull neilpang/acme.sh
|
|
|
|
# docker run --rm -it \
|
2017-12-09 16:46:17 +01:00
|
|
|
--volume prosody-acme:/acme.sh \
|
|
|
|
--net=host \
|
2018-11-22 19:24:05 +01:00
|
|
|
neilpang/acme.sh --issue \
|
|
|
|
-d example.com \
|
|
|
|
-d conference.example.com \
|
|
|
|
--standalone
|
2017-12-09 16:46:17 +01:00
|
|
|
```
|
2018-11-22 20:01:37 +01:00
|
|
|
.
|
|
|
|
.
|
2017-12-09 16:46:17 +01:00
|
|
|
To renew the certificate:
|
|
|
|
```console
|
2018-11-22 20:01:37 +01:00
|
|
|
# docker pull neilpang/acme.sh
|
|
|
|
# docker run --rm -it \
|
2017-12-09 16:46:17 +01:00
|
|
|
--volume prosody-acme:/acme.sh \
|
|
|
|
--net=host \
|
|
|
|
neilpang/acme.sh --cron --standalone
|
2018-11-22 20:01:37 +01:00
|
|
|
# docker run --rm \
|
2018-11-22 19:24:05 +01:00
|
|
|
-v prosody-acme:/acme.sh \
|
|
|
|
-v prosody-cfg:/target \
|
|
|
|
neilpang/acme.sh --install-cert \
|
|
|
|
-d example.com \
|
|
|
|
--key-file /target/certs/example.com/example.com.key \
|
|
|
|
--fullchain-file /target/certs/example.com/fullchain.cer
|
2018-11-22 20:01:37 +01:00
|
|
|
# docker restart prosody
|
2017-12-09 16:46:17 +01:00
|
|
|
```
|