From db481c7c6df714502488f1a972d5a3bf2d476d87 Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Tue, 3 Dec 2024 16:43:29 -0300 Subject: [PATCH 1/6] Corrige namespace --- tests/Api/EmployeeCreatedEventTest.php | 3 +-- tests/Api/StudentCreatedEventTest.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/Api/EmployeeCreatedEventTest.php b/tests/Api/EmployeeCreatedEventTest.php index 7ff3be4ae1..8052142158 100644 --- a/tests/Api/EmployeeCreatedEventTest.php +++ b/tests/Api/EmployeeCreatedEventTest.php @@ -1,13 +1,12 @@ Date: Tue, 3 Dec 2024 16:43:53 -0300 Subject: [PATCH 2/6] Corrige sintaxe --- docker/php/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index 1923176c19..a2db0ba7ff 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -1,4 +1,4 @@ -FROM composer:2.7 as composer +FROM composer:2.7 AS composer FROM php:8.3-fpm-alpine COPY --from=composer /usr/bin/composer /usr/local/bin/composer From dfc2c8623539027747da4d4741c2b74f08fdf072 Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Tue, 3 Dec 2024 17:07:55 -0300 Subject: [PATCH 3/6] =?UTF-8?q?Melhora=20configura=C3=A7=C3=B5es=20de=20po?= =?UTF-8?q?rtas=20do=20Docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- INSTALL.md | 10 ++-------- docker-compose.yml | 7 +++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 89f55dc778..456c347461 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -39,12 +39,6 @@ Clone o repositório: git clone git@github.com:portabilis/i-educar.git && cd i-educar ``` -Copie o arquivo `docker-compose.example.yml` e faça as configurações para o seu ambiente: - -```bash -cp docker-compose.example.yml docker-compose.override.yml -``` - Faça o build das imagens Docker utilizadas no projeto e inicie os containers da aplicação (pode levar alguns minutos): ```bash @@ -60,8 +54,8 @@ docker-compose exec php artisan db:seed ### Personalizando a instalação -No arquivo `docker-compose.override.yml` você pode personalizar sua instalação do i-Educar, mudando as portas dos -serviços ou o mapeamento dos volumes da aplicação. +Você pode criar o arquivo `docker-compose.override.yml` para personalizar sua instalação do i-Educar, mudando as portas +dos serviços ou o mapeamento dos volumes. ### Xdebug diff --git a/docker-compose.yml b/docker-compose.yml index 639b2f6273..e5370dcff6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,9 @@ services: volumes: - ./:/var/www/ieducar - ./docker/nginx:/etc/nginx/conf.d/ + ports: + - ${DOCKER_NGINX_PORT:-80}:80 + - ${DOCKER_NGINX_SSL_PORT:-443}:443 postgres: container_name: ieducar-postgres @@ -34,11 +37,15 @@ services: POSTGRES_PASSWORD: ieducar volumes: - postgres:/var/lib/postgresql/data + ports: + - ${DOCKER_POSTGRES_PORT:-5432}:5432 redis: container_name: ieducar-redis image: redis:7-alpine restart: always + ports: + - ${DOCKER_REDIS_PORT:-6379}:6379 volumes: postgres: From b965ce2c971970b0d37d9d2bec2b425d5d8c86fc Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Tue, 3 Dec 2024 17:57:41 -0300 Subject: [PATCH 4/6] Remove arquivo de exemplo --- docker-compose.example.yml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 docker-compose.example.yml diff --git a/docker-compose.example.yml b/docker-compose.example.yml deleted file mode 100644 index 1fb0010490..0000000000 --- a/docker-compose.example.yml +++ /dev/null @@ -1,13 +0,0 @@ -services: - - nginx: - ports: - - "80:80" - - postgres: - ports: - - "5432:5432" - - redis: - ports: - - "6379:6379" From 10430977beee654cf5c5143b8d5e933e5696558b Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Wed, 4 Dec 2024 15:16:45 -0300 Subject: [PATCH 5/6] =?UTF-8?q?Parametriza=20as=20vers=C3=B5es=20do=20PHP?= =?UTF-8?q?=20e=20Composer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 6 +++++- docker/php/Dockerfile | 7 +++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index e5370dcff6..cd66537c65 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,11 @@ services: php: container_name: ieducar-php - build: docker/php + build: + context: docker/php + args: + PHP_VERSION: 8.3 + COMPOSER_VERSION: 2.7 links: - postgres - redis diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index a2db0ba7ff..8705a18f80 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -1,5 +1,8 @@ -FROM composer:2.7 AS composer -FROM php:8.3-fpm-alpine +ARG PHP_VERSION=8 +ARG COMPOSER_VERSION=latest + +FROM composer:${COMPOSER_VERSION} AS composer +FROM php:${PHP_VERSION}-fpm-alpine COPY --from=composer /usr/bin/composer /usr/local/bin/composer From 73e680481d0343fe63e00fda91b820f580c0a54e Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Wed, 4 Dec 2024 16:29:01 -0300 Subject: [PATCH 6/6] =?UTF-8?q?Atualiza=20o=20guia=20de=20atualiza=C3=A7?= =?UTF-8?q?=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UPGRADE.md | 46 ++++++++++------------------------------------ 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 582750fbc3..5e35f78805 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -66,42 +66,16 @@ composer plug-and-play:update Sua instalação estará atualizada e você poderá realizar seu [primeiro acesso](https://github.com/portabilis/i-educar#primeiro-acesso) na nova versão do i-Educar. -### Configurar ambiente com Docker +### Personalizar o ambiente com Docker -Na versão [2.9](https://github.com/portabilis/i-educar/tree/2.9) o arquivo `docker-compose.yml` não expõem nenhuma porta -dos containers para evitar conflitos. Para isso, utilize o arquivo `docker-compose.override.yml` e configure quais -portas deseja que os serviços sejam executados. +Na versão [2.9](https://github.com/portabilis/i-educar/tree/2.9) o arquivo `docker-compose.yml` utiliza variáveis de +ambiente para expor as portas dos containers. Você pode adicionar no seu arquivo `.env`: -```bash -cp docker-compose.example.yml docker-compose.override.yml -``` +| Variável | Descrição | +|-------------------------|---------------------------| +| `DOCKER_NGINX_PORT` | Porta HTTP da aplicação | +| `DOCKER_NGINX_SSL_PORT` | Porta HTTPS da aplicação | +| `DOCKER_POSTGRES_PORT` | Porta do banco de Dados | +| `DOCKER_REDIS_PORT` | Porta do serviço de cache | -#### Arquivo de exemplo de configuração do `docker-compose.override.yml` - -O exemplo abaixo possui configurações básicas que podem ser customizadas e que não irão interferir no código fonte -original do projeto permitindo assim um maior controle do seu ambiente. - -```yml -services: - - php: - container_name: ieducar-php - volumes: - - ~/.ssh:/root/.ssh:ro # permite conexões usando suas chaves SSH - - nginx: - container_name: ieducar-nginx - ports: - - "80:80" # permite acessar o i-Educar em http://localhost, ou - - "8000:80" # permite acessar o i-Educar em http://localhost:8080 - - postgres: - container_name: ieducar-postgres - ports: - - "5432:5432" # permite conectar software gerenciador de banco de dados - - redis: - container_name: ieducar-redis - ports: - - "6379:6379" # permite conectar software gerenciador de banco de dados -``` +Você também pode utilizar o arquivo `docker-compose.override.yml` para mais configurações.