Skip to content

Feat: Add requirements using single file docker-compose.yaml #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 89 additions & 2 deletions v2/en/requirements/database.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The easiest and fastest way to set up a database for Evolution API v2 is through

To set up PostgreSQL via Docker, follow these steps:

1. Download the `docker-compose.yaml` file for PostgreSQL available [here](https://github.com/EvolutionAPI/evolution-api/blob/v2.0.0/Docker/postgres/docker-compose.yaml).
1. Download the `docker-compose.yaml` file for PostgreSQL available [here](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/postgres/docker-compose.yaml).
2. Navigate to the directory where the file was downloaded and run the command:

```bash
Expand All @@ -32,7 +32,7 @@ docker-compose up -d

To set up MySQL via Docker, follow these steps:

1. Download the `docker-compose.yaml` file for MySQL available [here](https://github.com/EvolutionAPI/evolution-api/blob/v2.0.0/Docker/mysql/docker-compose.yaml).
1. Download the `docker-compose.yaml` file for MySQL available [here](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/mysql/docker-compose.yaml).
2. Navigate to the directory where the file was downloaded and run the command:

```bash
Expand All @@ -41,6 +41,79 @@ docker-compose up -d

3. The MySQL instance will be available at `localhost` on port `3306`.

### Using Docker (Single file)

If you don't want to have separate containers, you can create a single file with the database and the Evolution API. Follow the steps below:

#### PostgreSQL

1. Download the `docker-compose.yaml` file for PostgreSQL available [here](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/postgres/docker-compose.yaml).
2. Open the file and add your Evolution API configuration specifying the `networks`. For example:
```yaml
services:
# Your Evolution API configuration:
evolution-api:
...
networks:
- evolution-net
...

# PostgreSQL configuration you downloaded:
postgres:
...

pgadmin:
...

volumes:
postgres_data:
pgadmin_data:
evolution_instances:

networks:
evolution-net:
name: evolution-net
driver: bridge
```

3. Save the file and run the command:
```bash
docker-compose up -d
```

#### MySQL

1. Download the `docker-compose.yaml` file for MySQL available [here](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/mysql/docker-compose.yaml).
2. Open the file and add your Evolution API configuration specifying `networks`. For example:

```yaml
services:
# Sua configuração do Evolution API:
evolution-api:
...
networks:
- evolution-net
...

# Configuração do MySQL que você baixou:
mysql:
...

volumes:
mysql_data:
evolution_instances:

networks:
evolution-net:
name: evolution-net
driver: bridge
```

3. Save the file and run the command:
```bash
docker-compose up -d
```

### Environment Variables Configuration

After setting up the database, define the following environment variables in your `.env` file:
Expand Down Expand Up @@ -68,6 +141,20 @@ DATABASE_SAVE_DATA_LABELS=true
DATABASE_SAVE_DATA_HISTORIC=true
```

If you use a single [docker-compose.yaml](#using-docker-single-file), you should replace `localhost` with the name of your database service. For example:

#### PostgreSQL
```env
# Database connection URI
DATABASE_CONNECTION_URI='postgresql://user:password@postgres:5432/evolution?schema=public'
```

#### MySQL
```env
# Database connection URI
DATABASE_CONNECTION_URI='postgresql://user:password@mysql:5432/evolution?schema=public'
```

### Local Installation

If you prefer to set up the database locally without using Docker, follow the instructions below:
Expand Down
43 changes: 42 additions & 1 deletion v2/en/requirements/redis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The easiest and fastest way to set up Redis for Evolution API v2 is through Dock

To set up Redis via Docker, follow these steps:

1. Download the `docker-compose.yaml` file for Redis available [here](https://github.com/EvolutionAPI/evolution-api/blob/v2.0.0/Docker/redis/docker-compose.yaml).
1. Download the `docker-compose.yaml` file for Redis available [here](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/redis/docker-compose.yaml).
2. Navigate to the directory where the file was downloaded and run the command:

```bash
Expand All @@ -24,6 +24,41 @@ docker-compose up -d

3. The Redis instance will be available at `localhost` on port `6379`.

### Using Docker (Single File)

If you don't want to have separate containers, you can create a single file with Redis and Evolution API. Follow the steps below:

1. Download the `docker-compose.yaml` file for Redis available [here](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/redis/docker-compose.yaml).
2. Open the file and add your Evolution API configuration specifying the `networks`. For example:

```yaml
services:
# Your Evolution API configuration:
evolution-api:
...
networks:
- evolution-net
...

# Redis configuration you downloaded:
redis:
...

volumes:
evolution_redis:
evolution_instances:

networks:
evolution-net:
name: evolution-net
driver: bridge
```

3. Save the file and run the command:
```bash
docker-compose up -d
```

### Environment Variables Configuration

After setting up Redis, define the following environment variables in your `.env` file:
Expand All @@ -45,6 +80,12 @@ CACHE_REDIS_SAVE_INSTANCES=false
CACHE_LOCAL_ENABLED=false
```

If you use a single [docker-compose.yaml](#using-docker-single-file), you should replace `localhost` with `redis`. For example:
```env
# Redis connection URI
CACHE_REDIS_URI=redis://redis:6379/6
```

### Local Installation

If you prefer to set up Redis locally without using Docker, follow the instructions below:
Expand Down
90 changes: 88 additions & 2 deletions v2/pt/requirements/database.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A maneira mais fácil e rápida de configurar um banco de dados para a Evolution

Para configurar o PostgreSQL via Docker, siga os passos abaixo:

1. Baixe o arquivo `docker-compose.yaml` para o PostgreSQL disponível [aqui](https://github.com/EvolutionAPI/evolution-api/blob/main/Docker/postgres/docker-compose.yaml).
1. Baixe o arquivo `docker-compose.yaml` para o PostgreSQL disponível [aqui](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/postgres/docker-compose.yaml).
2. Navegue até o diretório onde o arquivo foi baixado e execute o comando:

```bash
Expand All @@ -32,7 +32,7 @@ docker-compose up -d

Para configurar o MySQL via Docker, siga os passos abaixo:

1. Baixe o arquivo `docker-compose.yaml` para o MySQL disponível [aqui](https://github.com/EvolutionAPI/evolution-api/blob/v2.0.0/Docker/mysql/docker-compose.yaml).
1. Baixe o arquivo `docker-compose.yaml` para o MySQL disponível [aqui](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/mysql/docker-compose.yaml).
2. Navegue até o diretório onde o arquivo foi baixado e execute o comando:

```bash
Expand All @@ -41,6 +41,79 @@ docker-compose up -d

3. A instância do MySQL estará disponível no endereço `localhost` na porta `3306`.

### Utilizando Docker (Único arquivo)

Caso não queira ter containers separados, você pode criar um único arquivo com o banco de dados e o Evolution API. Siga os passos abaixo:

#### PostgreSQL

1. Baixe o arquivo `docker-compose.yaml` para o PostgreSQL disponível [aqui](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/postgres/docker-compose.yaml).
2. Abra o arquivo e acrescente sua configuração do Evolution API especificando o `networks`. Por exemplo:

```yaml
services:
# Sua configuração do Evolution API:
evolution-api:
...
networks:
- evolution-net
...

# Configuração do PostgreSQL que você baixou:
postgres:
...

pgadmin:
...

volumes:
postgres_data:
pgadmin_data:
evolution_instances:

networks:
evolution-net:
name: evolution-net
driver: bridge
```
3. Salve o arquivo e execute o comando:
```bash
docker-compose up -d
```

#### MySQL

1. Baixe o arquivo `docker-compose.yaml` para o MySQL disponível [aqui](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/mysql/docker-compose.yaml).
2. Abra o arquivo e acrescente sua configuração do Evolution API especificando o `networks`. Por exemplo:

```yaml
services:
# Sua configuração do Evolution API:
evolution-api:
...
networks:
- evolution-net
...

# Configuração do MySQL que você baixou:
mysql:
...

volumes:
mysql_data:
evolution_instances:

networks:
evolution-net:
name: evolution-net
driver: bridge
```

3. Salve o arquivo e execute o comando:
```bash
docker-compose up -d
```

### Configuração das Variáveis de Ambiente

Após configurar o banco de dados, defina as seguintes variáveis de ambiente no seu arquivo `.env`:
Expand All @@ -67,6 +140,19 @@ DATABASE_SAVE_DATA_CHATS=true
DATABASE_SAVE_DATA_LABELS=true
DATABASE_SAVE_DATA_HISTORIC=true
```
Caso use um único [docker-compose.yaml](#utilizando-docker-único-arquivo), você deve substituir o `localhost` pelo nome do serviço do banco de dados. Por exemplo:

#### PostgreSQL
```env
# URI de conexão com o banco de dados
DATABASE_CONNECTION_URI='postgresql://user:password@postgres:5432/evolution?schema=public'
```

#### MySQL
```env
# URI de conexão com o banco de dados
DATABASE_CONNECTION_URI='postgresql://user:password@mysql:5432/evolution?schema=public'
```

### Instalação Local

Expand Down
43 changes: 42 additions & 1 deletion v2/pt/requirements/redis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A maneira mais fácil e rápida de configurar o Redis para a Evolution API v2 é

Para configurar o Redis via Docker, siga os passos abaixo:

1. Baixe o arquivo `docker-compose.yaml` para o Redis disponível [aqui](https://github.com/EvolutionAPI/evolution-api/blob/v2.0.0/Docker/redis/docker-compose.yaml).
1. Baixe o arquivo `docker-compose.yaml` para o Redis disponível [aqui](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/redis/docker-compose.yaml).
2. Navegue até o diretório onde o arquivo foi baixado e execute o comando:

```bash
Expand All @@ -24,6 +24,41 @@ docker-compose up -d

3. A instância do Redis estará disponível no endereço `localhost` na porta `6379`.


### Utilizando Docker (Único arquivo)

Caso não queira ter containers separados, você pode criar um único arquivo com o Redis e o Evolution API. Siga os passos abaixo:

1. Baixe o arquivo `docker-compose.yaml` para o Redis disponível [aqui](https://github.com/EvolutionAPI/evolution-api/blob/2.2.3/Docker/redis/docker-compose.yaml).
2. Abra o arquivo e acrescente sua configuração do Evolution API especificando o `networks`. Por exemplo:

```yaml
services:
# Sua configuração do Evolution API:
evolution-api:
...
networks:
- evolution-net
...

# Configuração do Redis que você baixou:
redis:
...

volumes:
evolution_redis:
evolution_instances:

networks:
evolution-net:
name: evolution-net
driver: bridge
```
3. Salve o arquivo e execute o comando:
```bash
docker-compose up -d
```

### Configuração das Variáveis de Ambiente

Após configurar o Redis, defina as seguintes variáveis de ambiente no seu arquivo `.env`:
Expand All @@ -45,6 +80,12 @@ CACHE_REDIS_SAVE_INSTANCES=false
CACHE_LOCAL_ENABLED=false
```

Caso use um único [docker-compose.yaml](#utilizando-docker-único-arquivo), você deve substituir o `localhost` por `redis`. Por exemplo:
```env
# URI de conexão com o Redis
CACHE_REDIS_URI=redis://redis:6379/6
```

### Instalação Local

Caso prefira configurar o Redis localmente sem utilizar Docker, siga as instruções abaixo:
Expand Down