summaryrefslogtreecommitdiff
path: root/docker/biboumi/README.rst
blob: d2e2a7e418af628f39ba5a6b829cbc7067d5785c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Biboumi Docker Image
====================

Running
-------

This image does not embed any XMPP server. You need to have a running XMPP
server first: as an other docker image, or running on the host machine.

Assuming you have a running `prosody
<https://hub.docker.com/r/prosody/prosody/>`_ container already running and
`properly configured
<https://prosody.im/doc/components#adding_an_external_component>`_ you can
use the following command to start your biboumi container.

```
docker run --link prosody:xmpp \
    -v $PWD/database:/var/lib/biboumi \
    -e BIBOUMI_PASSWORD=P4SSW0RD \
    -e BIBOUMI_HOSTNAME=irc.example.com \
    -e BIBOUMI_ADMIN=blabla \
    biboumi
```

If instead you already have an XMPP server running on the host machine, you
can start the biboumi container like this:

```
docker run --network=host \
    -v $PWD/database:/var/lib/biboumi \
    -e BIBOUMI_PASSWORD=P4SSW0RD \
    -e BIBOUMI_HOSTNAME=irc.example.com \
    -e BIBOUMI_ADMIN=blabla \
    -e BIBOUMI_XMPP_SERVER_IP=127.0.0.1 \
    biboumi
```

Variables
---------

The configuration file inside the image is a template that is completed when
the container is started, using the following environment variables:

* BIBOUMI_HOSTNAME: Sets the value of the *hostname* option.
* BIBOUMI_SECRET: Sets the value of the *password* option.
* BIBOUMI_ADMIN: Sets the value of the *admin* option.
* BIBOUMI_XMPP_SERVER_IP: Sets the value of the *xmpp_server_ip* option. The default is **xmpp**.

All these variables are optional, but biboumi will probably fail to start if
the hostname and secret are missing.

You can also directly provide your own configuration file by mounting it
inside the container using the -v option:

```
docker run --link prosody:xmpp \
    -v $PWD/biboumi.cfg:/etc/biboumi/biboumi.cfg \
    biboumi
```

Linking with the XMPP server
----------------------------

You can use the --link option to connect to any server running in a docker
container, but it needs to be called *xmpp*, or the custom value set for the
**BIBOUMI_XMPP_SERVER_IP** option. For example, if you are using a container
named ejabberd, you would use the option *--link ejabberd:xmpp*.

If you want to connect to the XMPP server running on the host machine, use
the **--network=host** option.

Volumes
-------

The database is stored in the /var/lib/biboumi/ directory. If you don’t bind
a local directory to it, the database will be lost when the container is
stopped. If you want to keep your database between each run, bind it with
the -v option, like this: **-v /srv/biboumi/:/var/lib/biboumi**.

Building
--------

This image is built from 2 Dockerfiles:
- Dockerfile.base: builds and installs all the dependencies needed to build and run biboumi
- Dockerfile: builds and installs biboumi itself

The goal is to be able to force the rebuild of biboumi itself (by using
the --no-cache option) without having to rebuild and install all its
dependencies.

The build does not require any file in the build context, everything is
fetched during the build using git or dnf.

To build a biboumi image named “foo/biboumi”, you can run the script:

```
./build-docker.sh foo/biboumi
```