Add ability to run ejabberd with console attached

pull/2/head
Mickael Remond 8 years ago
parent b5d035eb93
commit 6c5b1f7e95
No known key found for this signature in database
GPG Key ID: E6F6045D79965AA3

@ -6,22 +6,46 @@ This ejabberd Docker image allows you to run a single node ejabberd instance in
### Default configuration for domain localhost ### Default configuration for domain localhost
You can run ejabberd with the following command: You can run ejabberd in a new container with the following command:
```bash ```bash
docker run -it -p 5222:5222 ejabberd/ecs docker run --name ejabberd -d -p 5222:5222 ejabberd/ecs
```
This command will run Docker image as a daemon, using ejabberd default configuration file and XMPP domain "localhost".
To stop the running container, you can run:
```bash
docker stop ejabberd
```
If needed you can restart the stopped ejabberd container with:
```bash
docker restart ejabberd
```
### Running ejabberd with Erlang console attached
If you would like to run it with console attached you can use the `console` command:
```bash
docker run -it -p 5222:5222 ejabberd/ecs console
``` ```
This command will use default configuration file and XMPP domain "localhost". This command will use default configuration file and XMPP domain "localhost".
### Running ejabberd with your config file and database host directory ### Running ejabberd with your config file and database host directory
The following command
```bash ```bash
mkdir db mkdir db
docker run --rm -it -v $(pwd)/db:/home/p1/db -p 5222:5222 ejabberd/ecs docker run --name ejabberd -v $(pwd)/ejabberd.yml:/home/p1/cfg/ejabberd.yml -v $(pwd)/db:/home/p1/db -p 5222:5222 ejabberd/ecs
``` ```
## Docker configuration ## Docker image advanced configuration
### Files ### Files
@ -35,8 +59,7 @@ ejabberd base Docker image exposes the following port:
- 5222: This is the default XMPP port for clients. - 5222: This is the default XMPP port for clients.
- 5280: This is the port for admin interface, API, Websockets and XMPP BOSH. - 5280: This is the port for admin interface, API, Websockets and XMPP BOSH.
- 5269: Optional. This is the port for XMPP federation. Only needed if you want - 5269: Optional. This is the port for XMPP federation. Only needed if you want to communicate with users on other servers.
to communicate with users on other servers.
### Volumes ### Volumes
@ -46,21 +69,22 @@ This is the kind of data you probably want to store on a persistent or local dri
Here are the volume you may want to map: Here are the volume you may want to map:
- /home/p1/log/: Directory containing log files - /home/p1/log/: Directory containing log files
- /home/p1/db/: Directory containing Mnesia database. You should backup or - /home/p1/db/: Directory containing Mnesia database. You should backup or export the content of the directory to persistent storage (host storage, local storage, any storage plugin)
export the content of the directory to persistent storage (host storage, local storage, any storage plugin)
## Generating ejabberd release ## Generating ejabberd release
### Configuration ### Configuration
Configuration of ejabberd release is customized with: Image is build by embedding an ejabberd Erlang/OTP standalone release in the image.
The configuration of ejabberd Erlang/OTP release is customized with:
- rel/config.exs: Customize ejabberd release - rel/config.exs: Customize ejabberd release
- rel/dev.exs: ejabberd environment configuration for development release - rel/dev.exs: ejabberd environment configuration for development release
- rel/docker.exs: ejabberd environment configuration for production Docker release - rel/docker.exs: ejabberd environment configuration for production Docker release
- ejabberd.yml: ejabberd default config file - ejabberd.yml: ejabberd default config file
Run the build script to generate ejabberd ecs base image from ejabberd master on Github: Run the build script to generate ejabberd Community Server base image from ejabberd master on Github:
```bash ```bash
./build.sh ./build.sh

@ -15,3 +15,14 @@ if [ "$1" = 'ejabberd' ]; then
su-exec p1 $HOME/ejabberd/bin/ejabberd foreground su-exec p1 $HOME/ejabberd/bin/ejabberd foreground
fi fi
if [ "$1" = 'console' ]; then
mkdir -p "$P1DATA"
chmod 700 "$P1DATA"
chown -R p1 "$P1DATA"
mkdir -p "$P1LOG"
chmod 700 "$P1LOG"
chown -R p1 "$P1LOG"
su-exec p1 $HOME/ejabberd/bin/ejabberd console
fi

Loading…
Cancel
Save