Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add new page to explain how to deploy Teleirc
This commit is part of issue #118. A new page is added specifically to explain how to deploy Teleirc. It consolidates the **Usage** section from `installation.rst` and all of the `using-docker.rst` page. This commit intends to make deployment options more clear and easy to understand. Some methods were removed, like the ArchLinux package. It is many updates behind on the bot, so I think it's better to recommend people to use directly from source where possible.
- Loading branch information
Showing
3 changed files
with
96 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
##################### | ||
How to deploy Teleirc | ||
##################### | ||
|
||
There are several ways to deploy Teleirc persistently. | ||
This page offers suggestions on possible deployment options. | ||
|
||
|
||
******* | ||
systemd | ||
******* | ||
|
||
The **recommended deployment method** is with `systemd <https://en.wikipedia.org/wiki/Systemd>`_. | ||
This method requires a basic understanding of systemd unit files. | ||
Create a unique systemd service for each Teleirc instance. | ||
|
||
A `provided systemd service <https://github.com/RITlug/teleirc/blob/master/misc/teleirc.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 | ||
*** | ||
|
||
`pm2 <http://pm2.keymetrics.io/>`_ 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 <http://pm2.keymetrics.io/docs/usage/quick-start/>`_ for more information. | ||
|
||
After pm2 is installed, run these commands to start Teleirc:: | ||
|
||
cd teleirc/ | ||
pm2 start -n my-teleirc-bot teleirc.js | ||
|
||
|
||
****** | ||
Docker | ||
****** | ||
|
||
Docker is another way to deploy Teleirc. | ||
Dockerfiles and images are available in ``images/``. | ||
|
||
Which image do I choose? | ||
======================== | ||
|
||
Node Alpine Linux and Fedora images are provided. | ||
|
||
+------------------------------------------------------------------------------+-----------------------+---------+ | ||
| Image | File | Size | | ||
+==============================================================================+=======================+=========+ | ||
| `Node Alpine Linux <https://hub.docker.com/r/_/node/>`_ (``node:10-alpine``) | ``Dockerfile.alpine`` | 374 MB | | ||
+------------------------------------------------------------------------------+-----------------------+---------+ | ||
| `Fedora latest <https://hub.docker.com/r/_/fedora/>`_ | ``Dockerfile.fedora`` | 569 MB | | ||
+------------------------------------------------------------------------------+-----------------------+---------+ | ||
|
||
This guide uses ``alpine``. | ||
If you wish to use ``fedora``, replace ``alpine`` with ``fedora``. | ||
|
||
Building Docker image | ||
===================== | ||
|
||
You may see errors running ``yarn``. | ||
You can safely ignore them. | ||
They are not fatal. | ||
|
||
.. code-block:: bash | ||
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 | ||
Docker Compose | ||
============== | ||
|
||
Optionally, you may use `docker-compose <https://docs.docker.com/compose>`_. | ||
An `example compose file <https://github.com/RITlug/teleirc/blob/master/images/docker-compose.yml.example>`_ is provided. | ||
|
||
Run these commands to use Docker Compose: | ||
|
||
.. code-block:: bash | ||
cp images/docker-compose.yml.example docker-compose.yml | ||
cp env.example .env | ||
docker-compose up -d teleirc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.