2021-06-21 11:56:14 +02:00
|
|
|
# Ergo Docker
|
2019-11-22 18:48:53 +01:00
|
|
|
|
2021-06-21 11:56:14 +02:00
|
|
|
This folder holds Ergo's Dockerfile and related materials. Ergo
|
2021-11-28 08:46:22 +01:00
|
|
|
is published automatically to the GitHub Container Registry at
|
2021-11-28 07:26:36 +01:00
|
|
|
[ghcr.io/ergochat/ergo](https://ghcr.io/ergochat/ergo).
|
2019-11-22 18:48:53 +01:00
|
|
|
|
2021-11-28 07:26:36 +01:00
|
|
|
Most users should use either the `stable` tag (corresponding to the
|
|
|
|
`stable` branch in git, which tracks the latest stable release), or
|
|
|
|
a tag corresponding to a tagged version (e.g. `v2.8.0`). The `master`
|
|
|
|
tag corresponds to the `master` branch, which is not recommended for
|
|
|
|
production use. The `latest` tag is not recommended.
|
2019-11-22 18:48:53 +01:00
|
|
|
|
|
|
|
## Quick start
|
|
|
|
|
2021-06-21 11:56:14 +02:00
|
|
|
The Ergo docker image is designed to work out of the box - it comes with a
|
2019-11-22 18:48:53 +01:00
|
|
|
usable default config and will automatically generate self-signed TLS
|
|
|
|
certificates. To get a working ircd, all you need to do is run the image and
|
|
|
|
expose the ports:
|
|
|
|
|
|
|
|
```shell
|
2021-11-28 07:26:36 +01:00
|
|
|
docker run --name ergo -d -p 6667:6667 -p 6697:6697 ghcr.io/ergochat/ergo:stable
|
2019-11-22 18:48:53 +01:00
|
|
|
```
|
|
|
|
|
2021-06-21 11:56:14 +02:00
|
|
|
This will start Ergo and listen on ports 6667 (plain text) and 6697 (TLS).
|
|
|
|
The first time Ergo runs it will create a config file with a randomised
|
2019-11-22 18:48:53 +01:00
|
|
|
oper password. This is output to stdout, and you can view it with the docker
|
|
|
|
logs command:
|
|
|
|
|
|
|
|
```shell
|
2021-06-21 11:56:14 +02:00
|
|
|
# Assuming your container is named `ergo`; use `docker container ls` to
|
2019-11-22 18:48:53 +01:00
|
|
|
# find the name if you're not sure.
|
2021-06-21 11:56:14 +02:00
|
|
|
docker logs ergo
|
2019-11-22 18:48:53 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
You should see a line similar to:
|
|
|
|
|
|
|
|
```
|
2020-03-31 19:35:24 +02:00
|
|
|
Oper username:password is admin:cnn2tm9TP3GeI4vLaEMS
|
2019-11-22 18:48:53 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
## Persisting data
|
|
|
|
|
2021-06-21 11:56:14 +02:00
|
|
|
Ergo has a persistent data store, used to keep account details, channel
|
2019-11-22 18:48:53 +01:00
|
|
|
registrations, and so on. To persist this data across restarts, you can mount
|
|
|
|
a volume at /ircd.
|
|
|
|
|
|
|
|
For example, to create a new docker volume and then mount it:
|
|
|
|
|
|
|
|
```shell
|
2021-06-21 11:56:14 +02:00
|
|
|
docker volume create ergo-data
|
2021-11-28 07:26:36 +01:00
|
|
|
docker run -d -v ergo-data:/ircd -p 6667:6667 -p 6697:6697 ghcr.io/ergochat/ergo:stable
|
2019-11-22 18:48:53 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Or to mount a folder from your host machine:
|
|
|
|
|
|
|
|
```shell
|
2021-06-21 11:56:14 +02:00
|
|
|
mkdir ergo-data
|
2021-11-28 07:26:36 +01:00
|
|
|
docker run -d -v $(PWD)/ergo-data:/ircd -p 6667:6667 -p 6697:6697 ghcr.io/ergochat/ergo:stable
|
2019-11-22 18:48:53 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
## Customising the config
|
|
|
|
|
2021-06-21 11:56:14 +02:00
|
|
|
Ergo's config file is stored at /ircd/ircd.yaml. If the file does not
|
2019-11-22 18:48:53 +01:00
|
|
|
exist, the default config will be written out. You can copy the config from
|
|
|
|
the container, edit it, and then copy it back:
|
|
|
|
|
|
|
|
```shell
|
2021-06-21 11:56:14 +02:00
|
|
|
# Assuming that your container is named `ergo`, as above.
|
|
|
|
docker cp ergo:/ircd/ircd.yaml .
|
2019-11-22 18:48:53 +01:00
|
|
|
vim ircd.yaml # edit the config to your liking
|
2021-06-21 11:56:14 +02:00
|
|
|
docker cp ircd.yaml ergo:/ircd/ircd.yaml
|
2019-11-22 18:48:53 +01:00
|
|
|
```
|
|
|
|
|
2021-06-21 11:56:14 +02:00
|
|
|
You can use the `/rehash` command to make Ergo reload its config, or
|
2019-11-22 18:48:53 +01:00
|
|
|
send it the HUP signal:
|
|
|
|
|
|
|
|
```shell
|
2021-10-29 16:56:36 +02:00
|
|
|
docker kill -s SIGHUP ergo
|
2019-11-22 18:48:53 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
## Using custom TLS certificates
|
|
|
|
|
|
|
|
TLS certs will by default be read from /ircd/tls.crt, with a private key
|
|
|
|
in /ircd/tls.key. You can customise this path in the ircd.yaml file if
|
|
|
|
you wish to mount the certificates from another volume. For information
|
|
|
|
on using Let's Encrypt certificates, see
|
2021-06-21 11:56:14 +02:00
|
|
|
[this manual entry](https://github.com/ergochat/ergo/blob/master/docs/MANUAL.md#using-valid-tls-certificates).
|
2019-11-22 18:48:53 +01:00
|
|
|
|
|
|
|
## Using docker-compose
|
|
|
|
|
|
|
|
This folder contains a sample docker-compose file which can be used
|
2021-06-21 11:56:14 +02:00
|
|
|
to start an Ergo instance with ports exposed and data persisted in
|
2019-11-22 18:48:53 +01:00
|
|
|
a docker volume. Simply download the file and then bring it up:
|
|
|
|
|
|
|
|
```shell
|
2021-06-21 11:56:14 +02:00
|
|
|
curl -O https://raw.githubusercontent.com/ergochat/ergo/master/distrib/docker/docker-compose.yml
|
2019-11-22 18:48:53 +01:00
|
|
|
docker-compose up -d
|
|
|
|
```
|
|
|
|
|
|
|
|
## Building
|
|
|
|
|
|
|
|
If you wish to manually build the docker image, you need to do so from
|
2021-06-21 11:56:14 +02:00
|
|
|
the root of the Ergo repository (not the `distrib/docker` directory):
|
2019-11-22 18:48:53 +01:00
|
|
|
|
|
|
|
```shell
|
2020-07-14 05:43:19 +02:00
|
|
|
docker build .
|
2019-11-22 18:48:53 +01:00
|
|
|
```
|
|
|
|
|