2018-04-26 17:24:58 +00:00
# Docker build scripts for Prosody build server
2014-11-13 15:21:28 +00:00
2018-04-26 17:24:58 +00:00
This is the Prosody Docker image building repository. It is used by our build server to build and publish Docker images for stable releases and nightly builds.
2014-11-17 09:34:26 +00:00
2018-04-26 17:24:58 +00:00
**Note:** Using this Dockerfile outside of our build server is not a supported use-case. There are many
alternative Dockerfiles for Prosody available which can be used for this:
2014-11-13 15:21:28 +00:00
2018-04-26 17:24:58 +00:00
- [OpusVL/prosody-docker ](https://github.com/OpusVL/prosody-docker/ )
- [unclev/prosody-docker-extended ](https://github.com/unclev/prosody-docker-extended )
## Published images
For images please see here: [Prosody on Docker ](https://hub.docker.com/r/prosody/prosody/ ).
2014-11-13 15:21:28 +00:00
2014-12-08 02:59:37 +00:00
## Running
2014-11-14 09:12:07 +00:00
2018-04-26 17:24:58 +00:00
It works by copying in a recently built `deb` file and running the install on the system.
2020-02-13 23:47:17 +00:00
Docker images are built off an __Debian 10 (buster)__ base.
2014-11-13 15:21:28 +00:00
```bash
2014-12-20 22:10:39 +00:00
docker run -d --name prosody -p 5222:5222 prosody/prosody
2014-11-13 15:21:28 +00:00
```
2014-12-08 02:59:37 +00:00
A user can be created by using environment variables `LOCAL` , `DOMAIN` , and `PASSWORD` . This performs the following action on startup:
2014-11-25 15:10:21 +00:00
prosodyctl register *local* *domain* *password*
2014-12-08 02:59:37 +00:00
2014-11-25 15:10:21 +00:00
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).
2014-11-14 09:12:07 +00:00
### Ports
2014-11-13 15:21:28 +00:00
The image exposes the following ports to the docker host:
* __80__: HTTP port
* __5222__: c2s port
* __5269__: s2s port
* __5347__: XMPP component port
* __5280__: BOSH / websocket port
2014-11-24 14:27:32 +00:00
* __5281__: Secure BOSH / websocket port
2014-11-13 15:21:28 +00:00
Note: These default ports can be changed in your configuration file. Therefore if you change these ports will not be exposed.
2014-11-14 09:12:07 +00:00
### Volumes
2014-11-13 15:21:28 +00:00
Volumes can be mounted at the following locations for adding in files:
* __/etc/prosody__:
* Prosody configuration file(s)
* SSL certificates
* __/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
2015-03-20 16:00:41 +00:00
* Also note: The log directory on the host (/logs/prosody in the example below) must be writeable by the prosody user
2014-11-13 15:21:28 +00:00
* __/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
2014-11-14 09:12:07 +00:00
### Example
2014-11-13 15:21:28 +00:00
```
2015-03-15 15:48:51 +00:00
docker run -d \
2014-11-13 15:21:28 +00:00
-p 5222:5222 \
-p 5269:5269 \
-p localhost:5347:5347 \
2014-11-25 15:10:21 +00:00
-e LOCAL=romeo \
-e DOMAIN=shakespeare.lit \
-e PASSWORD=juliet4ever \
2015-03-16 14:57:01 +00:00
-v /data/prosody/configuration:/etc/prosody \
-v /logs/prosody:/var/log/prosody \
2015-03-30 22:37:43 +00:00
-v /data/prosody/modules:/usr/lib/prosody-modules \
2015-03-15 15:48:51 +00:00
prosody/prosody:0.9
2014-11-14 09:12:07 +00:00
```
## Building
Use the `build-docker.sh` script as follows:
```bash
2014-11-15 15:16:11 +00:00
./build-docker.sh /path/to/built-image.deb version_tag [, ...version_tag2, ...]
2014-11-14 09:12:07 +00:00
```
2014-12-08 02:59:37 +00:00
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.
2014-11-15 15:16:11 +00:00
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.
After running the script will clean up any images generated (but not the base images - for efficiency purposes).