There are several ways to deploy Teleirc persistently. This page offers suggestions on possible deployment options.
The recommended deployment method is with systemd. This method requires a basic understanding of systemd unit files. Create a unique systemd service for each Teleirc instance.
A provided systemd service file is available.
Add the systemd unit file to /usr/lib/systemd/system/
to activate it.
Now, systemctl
can be used to control your Teleirc instance.
Note the provided file makes two assumptions:
- Using a dedicated system user (e.g.
teleirc
) - Teleirc config files located at
/usr/lib64/teleirc/
(i.e. files inside Teleirc repository)
pm2 keeps NodeJS running in the background. If you run an application and it crashes, pm2 restarts the process. pm2 also restarts processes if the server reboots. Read the pm2 documentation for more information.
After pm2 is installed, run these commands to start Teleirc:
cd teleirc/ pm2 start -n my-teleirc-bot teleirc.js
On ArchLinux, see teleirc-git in the AUR.
The AUR package uses the systemd method to deploy Teleirc.
Place Teleirc configuration files in the /usr/lib/teleirc/
directory.
Docker is another way to deploy Teleirc.
Dockerfiles and images are available in images/
.
Node Alpine Linux and Fedora images are provided.
Image | File | Size |
---|---|---|
Node Alpine Linux (node:10-alpine ) |
Dockerfile.alpine |
374 MB |
Fedora latest | Dockerfile.fedora |
569 MB |
This guide uses alpine
.
If you wish to use fedora
, replace alpine
with fedora
.
You may see errors running yarn
.
You can safely ignore them.
They are not fatal.
docker build . -f images/Dockerfile.alpine -t teleirc
docker run -d -u teleirc --name teleirc --restart always \
-e TELEIRC_TOKEN="000000000:AAAAAAaAAa2AaAAaoAAAA-a_aaAAaAaaaAA" \
-e IRC_CHANNEL="#channel" \
-e IRC_BOT_NAME="teleirc" \
-e IRC_BLACKLIST="CowSayBot,AnotherNickToIgnore" \
-e TELEGRAM_CHAT_ID="-0000000000000" \
teleirc
Optionally, you may use docker-compose. An example compose file is provided.
Run these commands to use Docker Compose:
cp images/docker-compose.yml.example docker-compose.yml
cp env.example .env
docker-compose up -d teleirc