GITBOOK-95: abdousfayhi12's Nov 20 changes

This commit is contained in:
Mohamed Marrouchi
2024-11-20 19:41:28 +00:00
committed by gitbook-bot
parent 597bf960bc
commit a5ad765d15
5 changed files with 330 additions and 18 deletions

View File

@@ -0,0 +1,49 @@
# Setting Up Docker for Development and Production
Hexabot uses Docker for development purposes as well as streamline deployment, running essential services like the API, frontend, and MongoDB in containers. The provided Docker Compose setup ensures quick and consistent startup, eliminating manual configuration complexities.
{% hint style="info" %}
The following is an example on how to install Docker on a Ubuntu machine. If you have a different OS, please check the official guide on how to install Docker on your system [https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/) 
{% endhint %}
1. Set up Docker's apt repository:
```bash
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo
\"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
```
2. Install Docker Community Edition:
```bash
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```
3. Check if Docker is running:
<pre class="language-bash"><code class="lang-bash"><strong>sudo systemctl status docker
</strong></code></pre>
4. Add your user to the Docker group:
```bash
sudo usermod -aG docker $USER
```
5. To apply the new group membership, log out of the server and back in, or type the following:
```bash
su - ${USER}
```

View File

@@ -0,0 +1,43 @@
# Setup Node.js with NVM
Node.js is a pre-requisite to run both the Hexabot CLI and a Hexabot project since the API is built on NestJS. Using [NVM](https://github.com/nvm-sh/nvm) (Node Version Manager) simplifies managing the required Node.js version. When creating a new Hexabot project, the structure includes source folders like **extensions** to add custom plugins, helpers and channels, making Node.js essential tool for smooth development and customization.
If you are new to NVM, please follow these steps to install:
1. Update the system:
```bash
sudo apt update
```
2. Install NVM:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
```
Close and reopen your terminal to start using nvm or run the following to use it now:
```bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
```
3. Verify the NVM installation:
```bash
nvm --version
```
4. Install Node.js version 18.17.0 or higher :
```bash
nvm install 18.17.0
```
5. Check default Node.js version:
```bash
node --version
```