|
| 1 | +====== |
| 2 | +Docker |
| 3 | +====== |
| 4 | + |
| 5 | +.. warning:: |
| 6 | + |
| 7 | + This method of deployment is only for internal use within the transprogrammer community. |
| 8 | + In addition, this deployment method is fairly advanced. This guide is only intended for internal |
| 9 | + documentation for possible deployment options. |
| 10 | + |
| 11 | +Docker Compose can be used to run an Rodhaj instance in production. This will only work if you have access to the |
| 12 | +Rodhaj Docker images. |
| 13 | + |
| 14 | +Step 1 - Download required files |
| 15 | +================================ |
| 16 | + |
| 17 | +Download the necessary archive for getting started. This archive contains all |
| 18 | +of the files needed to get started. These are provided either in ``.zip`` or ``.tar.gz`` |
| 19 | +formats. |
| 20 | + |
| 21 | +.. code-block:: bash |
| 22 | +
|
| 23 | + wget https://github.com/transprogrammer/rodhaj/releases/latest/download/rodhaj-docker.tar.gz |
| 24 | +
|
| 25 | + # .zip version download |
| 26 | + wget https://github.com/transprogrammer/rodhaj/releases/latest/download/rodhaj-docker.zip |
| 27 | +
|
| 28 | +We need to unpack the archive in order to access the files. The following commands should do that. |
| 29 | + |
| 30 | +.. code-block:: bash |
| 31 | +
|
| 32 | + tar -xvzf rodhaj-docker.tar.gz |
| 33 | +
|
| 34 | + # .zip version unpacking |
| 35 | + unzip rodhaj-docker.zip |
| 36 | +
|
| 37 | +Once we have the files, we can now ``cd`` into the new extracted archive. |
| 38 | + |
| 39 | +.. code-block:: bash |
| 40 | + |
| 41 | + cd rodhaj-docker |
| 42 | +
|
| 43 | +.. important:: |
| 44 | + |
| 45 | + Throughout the rest of the guide, the next steps assume that |
| 46 | + you are in the ``rodhaj-docker`` directory. |
| 47 | + |
| 48 | +Step 2 - Populate ``.env`` and ``config.yml`` file with values |
| 49 | +============================================================== |
| 50 | + |
| 51 | +- Change ``DB_PASSWORD`` to a randomly generated password. |
| 52 | +- Provide Rodhaj's bot token in ``config.yml`` |
| 53 | +- Change ``rodhaj.guild_id`` in ``config.yml`` to the server ID that Rodhaj is running on |
| 54 | +- Modify the PostgreSQL URI used in ``config.yml`` to redirect to the database container and appropriate password |
| 55 | + |
| 56 | +.. note:: |
| 57 | + |
| 58 | + In order for Rodhaj to work container-wise, the IP aliases that is provided by the compose file |
| 59 | + must be used instead. For example, the URI would look like this (of course replace the password): |
| 60 | + |
| 61 | + .. code-block:: |
| 62 | +
|
| 63 | + postgresql://postgres:somepwd@database:5432/rodhaj |
| 64 | +
|
| 65 | +.. important:: |
| 66 | + |
| 67 | + If you are running the full production version, please enable the Prometheus metrics |
| 68 | + found in Rodhaj's configuration |
| 69 | + |
| 70 | +Step 3 - Start all containers |
| 71 | +============================= |
| 72 | + |
| 73 | +Assume that you are in the directory created in Step 1, run the following command to bring up Rodhaj entirely. |
| 74 | + |
| 75 | +.. code-block:: |
| 76 | +
|
| 77 | + docker compose up -d |
| 78 | +
|
| 79 | +.. tip:: |
| 80 | + |
| 81 | + If you are having issues downloading container images, you will need to authenticate to the Github Container |
| 82 | + Registry. Steps can be found `here <https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-to-the-container-registry>`_. |
| 83 | + |
| 84 | +Step 4 - Upgrading |
| 85 | +================== |
| 86 | + |
| 87 | +.. danger:: |
| 88 | + |
| 89 | + Although Rodhaj doesn't often update version-wise, there |
| 90 | + may be breaking changes between versions. Be careful and be |
| 91 | + up-to-date with changes. |
| 92 | + |
| 93 | +Upgrading Rodhaj is very simple. All you need to do is run the following commands below: |
| 94 | + |
| 95 | +.. code-block:: bash |
| 96 | +
|
| 97 | + docker compose pull && docker compose up -d |
0 commit comments