feat: add docker

This commit is contained in:
Gabriel Pastori 2023-11-24 13:22:20 -03:00
parent ad92e35523
commit df548543bf
7 changed files with 333 additions and 71 deletions

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
# Use a imagem oficial do Node.js 20 como base
FROM node:20-slim
WORKDIR /usr/src/app
RUN npm install -g vite
RUN ln -s /usr/local/bin/node /usr/bin/node
ENTRYPOINT ["npx", "evolution-manager", "server", "start"]
EXPOSE 9615

View File

@ -28,45 +28,17 @@ Se você é um desenvolvedor ou usuário brasileiro interessado no Evolution Man
- The project is built using Vue.js v3 and Vuetify.
## Development Setup
1. **Prerequisites**: Ensure you have `yarn` installed on your system.
2. **Clone the Repository**:
```bash
git clone https://github.com/gabrielpastori1/evolution-manager.git
cd evolution-manager
```
3. **Install Dependencies**:
```bash
yarn install
```
4. **Run Development Server**:
```bash
yarn dev
```
This will start a local development server. You can access the app at `localhost:8080`.
## Building the Project
To build the project for production, run:
```bash
yarn build
```
This will create a `dist` folder with the compiled assets.
## Evolution-Manager CLI - Documentation
For detailed information on how to use the Evolution-Manager CLI, please refer to the documentation available at the following links:
- [Documentation in English](https://github.com/gabrielpastori1/evolution-manager/blob/main/docs/en/cli.md)
🔗 Full Documentation: [Documentation in English](https://github.com/gabrielpastori1/evolution-manager/blob/main/docs/en/cli.md)
## Docker Image - Documentation
For detailed information on using the Docker image, including configurations and examples, please refer to our comprehensive documentation. You will find step-by-step instructions, as well as helpful tips to make the most of the Evolution Manager's Docker image.
🔗 Full Documentation: [Documentation in English](https://github.com/gabrielpastori1/evolution-manager/tree/main/docs/en/docker.md)
## Self-Hosted - Evolution Manager CLI and PM2
@ -125,6 +97,40 @@ These two steps will install the Evolution Manager CLI globally on your system a
These instructions provide a streamlined method for managing Evolution Manager across various systems, utilizing PM2 for efficient service start-up, maintenance, and control.
## Development Setup
1. **Prerequisites**: Ensure you have `yarn` installed on your system.
2. **Clone the Repository**:
```bash
git clone https://github.com/gabrielpastori1/evolution-manager.git
cd evolution-manager
```
3. **Install Dependencies**:
```bash
yarn install
```
4. **Run Development Server**:
```bash
yarn dev
```
This will start a local development server. You can access the app at `localhost:8080`.
## Building the Project
To build the project for production, run:
```bash
yarn build
```
This will create a `dist` folder with the compiled assets.
## Contributing
Contributions are an essential part of the Evolution Manager project. Whether you're contributing code, suggestions, or feedback, your input is invaluable. To facilitate contributions, we have included a direct means for donations:

View File

@ -18,45 +18,19 @@ O Evolution Manager é uma ferramenta de gerenciamento open-source para a Evolut
- O projeto é desenvolvido usando Vue.js v3 e Vuetify.
## Configuração para Desenvolvimento
1. **Pré-requisitos**: Certifique-se de ter o `yarn` instalado no seu sistema.
2. **Clonar o Repositório**:
```bash
git clone https://github.com/gabrielpastori1/evolution-manager.git
cd evolution-manager
```
3. **Instalar Dependências**:
```bash
yarn install
```
4. **Executar o Servidor de Desenvolvimento**:
```bash
yarn dev
```
Isso iniciará um servidor de desenvolvimento local. Você pode acessar o aplicativo em `localhost:8080`.
## Construção do Projeto
Para construir o projeto para produção, execute:
```bash
yarn build
```
Isso criará uma pasta `dist` com os ativos compilados.
## Evolution-Manager CLI - Documentação
Para informações detalhadas sobre como usar o Evolution-Manager CLI, consulte a documentação disponível nos seguintes links:
- [Documentação em Português](https://github.com/gabrielpastori1/evolution-manager/blob/main/docs/pt_br/cli.md)
🔗 Documentação completa: [Documentação em Português](https://github.com/gabrielpastori1/evolution-manager/blob/main/docs/pt_br/cli.md)
## Imagem Docker - Documentação
Para obter informações detalhadas sobre como usar a imagem Docker, incluindo configurações e exemplos, acesse a nossa documentação completa. Você encontrará instruções passo a passo, bem como dicas úteis para maximizar o uso da imagem Docker do Evolution Manager.
🔗 Documentação completa: [Documentação em Português](https://github.com/gabrielpastori1/evolution-manager/tree/main/docs/pt_br/docker.md)
---
## Auto-Hospedagem - CLI e PM2 do Evolution Manager
@ -115,6 +89,40 @@ Esses dois passos instalarão o CLI do Evolution Manager globalmente em seu sist
Estas instruções fornecem um método simplificado para gerenciar o Evolution Manager em vários sistemas, utilizando o PM2 para um eficiente início de serviço
## Configuração para Desenvolvimento
1. **Pré-requisitos**: Certifique-se de ter o `yarn` instalado no seu sistema.
2. **Clonar o Repositório**:
```bash
git clone https://github.com/gabrielpastori1/evolution-manager.git
cd evolution-manager
```
3. **Instalar Dependências**:
```bash
yarn install
```
4. **Executar o Servidor de Desenvolvimento**:
```bash
yarn dev
```
Isso iniciará um servidor de desenvolvimento local. Você pode acessar o aplicativo em `localhost:8080`.
## Construção do Projeto
Para construir o projeto para produção, execute:
```bash
yarn build
```
Isso criará uma pasta `dist` com os ativos compilados.
## Contribuindo
As contribuições são uma parte essencial do projeto Evolution Manager. Seja contribuindo com código, sugestões ou feedback, sua participação é inestimável. Para facilitar as contribuições, incluímos um meio direto para doações:

6
docker-compose.yml Normal file
View File

@ -0,0 +1,6 @@
version: '3'
services:
evolution-manager:
image: "gabrielpastori1/evolution-manager:latest"
ports:
- "9615:9615"

115
docs/en/docker.md Normal file
View File

@ -0,0 +1,115 @@
# Docker Image of Evolution Manager
This README file describes how to use the Evolution Manager Docker image and set up a domain using [Traefik](#configuring-the-domain-with-traefik) or [NGINX](#configuring-the-domain-with-nginx).
## Using the Docker Image
The Evolution Manager Docker image provides an easy and automated setup and updating of the system. When the container is started, the latest version of the Evolution Manager will be downloaded and installed.
### Prerequisites
- Docker installed on your machine.
- Basic knowledge of Docker operations.
### Running the Container
To start a container with the Evolution Manager, execute the following command:
```sh
docker run -d -p 9615:9615 gabrielpastori1/evolution-manager:latest
```
This command runs the container in detached mode and maps port 9615 of the container to port 9615 of the host.
### Exposed Port
The image exposes port `9615`, which should be mapped to the corresponding port on the host.
## Configuring the Domain with Traefik
To configure a domain and make the Evolution Manager accessible via the web, you can use Traefik as a reverse proxy.
### Prerequisites
- Traefik configured on your server.
- A domain pointing to the server where Traefik is running.
### Traefik Configuration
1. **Create a `docker-compose.yml` file** in the directory where you want to start the Evolution Manager, with the following content:
```yaml
version: '3'
services:
evolution-manager:
image: gabrielpastori1/evolution-manager:latest
restart: unless-stopped
ports:
- "9615:9615"
labels:
- "traefik.enable=true"
- "traefik.http.routers.evolution-manager.rule=Host(`your-domain.com`)"
- "traefik.http.routers.evolution-manager.entrypoints=web"
# Add other label configurations as necessary for Traefik
networks:
default:
external:
name: traefik_default
```
2. **Replace** `your-domain.com` with the domain you want to use.
3. **Ensure** that the specified external network (`traefik_default`) matches the network used by Traefik in its setup.
### Starting the Service
With the `docker-compose.yml` file configured, start the service with the following command:
```sh
docker-compose up -d
```
Traefik will automatically detect the service and apply the rules defined in the container's labels.
## Configuring the Domain with NGINX
If you prefer using NGINX as a reverse proxy instead of Traefik, follow the steps below.
### Prerequisites
- NGINX installed on your server.
- A domain pointing to your server's IP where NGINX is running.
### NGINX Configuration
1. **Create an NGINX Configuration File**: To redirect requests from your domain to the container, you need to create a configuration file in `/etc/nginx/conf.d/` with the following content:
```nginx
server {
listen 80;
server_name your-domain.com;
location / {
proxy_pass http://localhost:9615;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
```
2. **Replace** `your-domain.com` with your actual domain.
3. **Check the NGINX Configuration**: Run `nginx -t` to ensure there are no errors in the configuration.
4. **Reload NGINX**: After verifying the configuration, reload the NGINX service with `service nginx reload` or `systemctl reload nginx`.
Now NGINX will redirect requests from your domain to port `9615`, where your Docker container is listening.
## Support and Contributions
For support, questions, or contributions, open an issue or send a pull request on the [GitHub repository](https://github.com/gabrielpastori1/evolution-manager). Your participation is very welcome!

115
docs/pt_br/docker.md Normal file
View File

@ -0,0 +1,115 @@
# Imagem Docker do Evolution Manager
Este arquivo README descreve como usar a imagem Docker do Evolution Manager e configurar um domínio utilizando o [Traefik](#configurando-o-domínio-com-o-traefik) ou [NGINX](#configurando-o-domínio-com-o-nginx).
## Usando a Imagem Docker
A imagem Docker do Evolution Manager permite uma instalação e atualização fáceis e automatizadas do sistema. Ao iniciar o container, a versão mais recente do Evolution Manager será baixada e instalada.
### Pré-requisitos
- Docker instalado em sua máquina.
- Conhecimento básico de operações do Docker.
### Executando o Container
Para iniciar o container com o Evolution Manager, execute o seguinte comando:
```sh
docker run -d -p 9615:9615 gabrielpastori1/evolution-manager:latest
```
Este comando executa o container em modo detached e mapeia a porta 9615 do container para a porta 9615 do host.
### Porta Exposta
A imagem expõe a porta `9615`, que deve ser mapeada para a porta correspondente no host.
## Configurando o Domínio com o Traefik
Para configurar um domínio e deixar o Evolution Manager acessível via web, você pode usar o Traefik como um proxy reverso.
### Pré-requisitos
- Ter o Traefik configurado em seu servidor.
- Possuir um domínio apontando para o servidor onde o Traefik está rodando.
### Configuração do Traefik
1. **Crie um arquivo `docker-compose.yml`** no diretório onde você deseja iniciar o Evolution Manager, com o seguinte conteúdo:
```yaml
version: '3'
services:
evolution-manager:
image: gabrielpastori1/evolution-manager:latest
restart: unless-stopped
ports:
- "9615:9615"
labels:
- "traefik.enable=true"
- "traefik.http.routers.evolution-manager.rule=Host(`seu-dominio.com`)"
- "traefik.http.routers.evolution-manager.entrypoints=web"
# Adicione outras configurações de labels conforme necessário para o Traefik
networks:
default:
external:
name: traefik_default
```
2. **Substitua** `seu-dominio.com` pelo domínio que você deseja usar.
3. **Certifique-se** de que a rede externa especificada (`traefik_default`) corresponda à rede usada pelo Traefik em sua configuração.
### Iniciando o Serviço
Com o arquivo `docker-compose.yml` configurado, inicie o serviço com o seguinte comando:
```sh
docker-compose up -d
```
O Traefik automaticamente detectará o serviço e aplicará as regras definidas nas labels do container.
## Configurando o Domínio com o NGINX
Se preferir usar o NGINX como um proxy reverso em vez do Traefik, siga os passos abaixo.
### Pré-requisitos
- NGINX instalado no seu servidor.
- Domínio apontando para o IP do seu servidor onde o NGINX está rodando.
### Configuração do NGINX
1. **Crie um Arquivo de Configuração do NGINX**: Para redirecionar as requisições do seu domínio para o container, você precisará criar um arquivo de configuração do NGINX em `/etc/nginx/conf.d/` com o seguinte conteúdo:
```nginx
server {
listen 80;
server_name seu-dominio.com;
location / {
proxy_pass http://localhost:9615;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
```
2. **Substitua** `seu-dominio.com` pelo seu domínio real.
3. **Verifique a Configuração do NGINX**: Execute `nginx -t` para verificar se não há erros na configuração.
4. **Recarregue o NGINX**: Após verificar a configuração, recarregue o serviço do NGINX com `service nginx reload` ou `systemctl reload nginx`.
Agora o NGINX redirecionará as requisições do seu domínio para a porta `9615`, onde o seu container Docker está escutando.
## Suporte e Contribuições
Para suporte, dúvidas ou contribuições, abra uma issue ou envie um pull request no [repositório do GitHub](https://github.com/gabrielpastori1/evolution-manager). Sua participação é muito bem-vinda!

View File

@ -1,6 +1,6 @@
{
"name": "evolution-manager",
"version": "0.3.6",
"version": "0.3.7",
"main": "dist",
"engines": {
"node": ">=16.0.0"