From 2d99f45e75692c63272039e9f1766fc5000e92ae Mon Sep 17 00:00:00 2001 From: Benoit Foujols Date: Thu, 28 Mar 2024 22:51:16 +0100 Subject: [PATCH] #68 del docker old CLI --- compose.yaml | 3 + docker/docker-compose-maria-db.yml | 42 ----------- docker/docker-compose-mysql-5.yml | 39 ---------- src/EduFramework/Scripts/DockerPilot.php | 72 ------------------- .../DockerPilotInvalidArgumentException.php | 12 ---- 5 files changed, 3 insertions(+), 165 deletions(-) delete mode 100644 docker/docker-compose-maria-db.yml delete mode 100644 docker/docker-compose-mysql-5.yml delete mode 100644 src/EduFramework/Scripts/DockerPilot.php delete mode 100644 src/EduFramework/Scripts/Exception/DockerPilotInvalidArgumentException.php diff --git a/compose.yaml b/compose.yaml index 2c5953b..c2c8f27 100644 --- a/compose.yaml +++ b/compose.yaml @@ -11,6 +11,9 @@ services: environment: MYSQL_DATABASE: app_db MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' + #MYSQL_ROOT_PASSWORD: root + #MYSQL_USER: app_db_user + #MYSQL_PASSWORD: app_db_password volumes: - ./var/dbdata:/var/lib/mysql phpmyadmin: diff --git a/docker/docker-compose-maria-db.yml b/docker/docker-compose-maria-db.yml deleted file mode 100644 index d8a5923..0000000 --- a/docker/docker-compose-maria-db.yml +++ /dev/null @@ -1,42 +0,0 @@ -version: "3.8" -services: - ########################## - # CONTENEURS SERVICES # - ########################## - - #Base de données Mysql - database: - container_name: ${APP_NAME}-database - image: mariadb:10.5.8 - restart: always - ports: - - "3306:3306" - volumes: - - ../var/db-data:/var/lib/mysql - environment: - #MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' - MYSQL_ROOT_PASSWORD: ${DB_PASSWORD} - MYSQL_DATABASE: ${DB_NAME} - #MYSQL_USER: app_db_user - #MYSQL_PASSWORD: app_db_password - networks: - - dev - #PHP My Admin - phpmyadmin: - container_name: ${APP_NAME}-pma - image: phpmyadmin:latest - restart: always - depends_on: - - database - ports: - - "8081:80" - environment: - PMA_HOST: database - networks: - - dev -#Network -networks: - dev: -#Volumes -volumes: - db-data: diff --git a/docker/docker-compose-mysql-5.yml b/docker/docker-compose-mysql-5.yml deleted file mode 100644 index c3503a6..0000000 --- a/docker/docker-compose-mysql-5.yml +++ /dev/null @@ -1,39 +0,0 @@ -version: "3.8" -services: - - database: - container_name: ${APP_NAME}-database - image: mysql:5.7 - platform: linux/amd64 - ports: - - "3306:3306" - restart: always - environment: - #MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' - MYSQL_ROOT_PASSWORD: ${DB_PASSWORD} - MYSQL_DATABASE: ${DB_NAME} - #MYSQL_USER: app_db_user - #MYSQL_PASSWORD: app_db_password - networks: - - dev - volumes: - - ../var/dbdata:/var/lib/mysql - #PHP My Admin - phpmyadmin: - container_name: ${APP_NAME}-pma - image: phpmyadmin:latest - restart: always - depends_on: - - database - ports: - - "8081:80" - environment: - PMA_HOST: database - networks: - - dev -#Network -networks: - dev: -#Volumes -volumes: - db-data: diff --git a/src/EduFramework/Scripts/DockerPilot.php b/src/EduFramework/Scripts/DockerPilot.php deleted file mode 100644 index deb84d1..0000000 --- a/src/EduFramework/Scripts/DockerPilot.php +++ /dev/null @@ -1,72 +0,0 @@ -getArguments()[0] ?? null) { - 'mysql' => self::DOCKER_COMPOSE_MYSQL_RECIPE, - 'maria-db' => self::DOCKER_COMPOSE_MARIADB_RECIPE, - default => null - }; - - if (isset($recipe) === false) { - throw new DockerPilotInvalidArgumentException(); - } - - return "docker compose -f $recipe --env-file .env $instruction"; - } - - /** - * @param Event $event Nom de l'événement - * @return void - * @throws DockerPilotInvalidArgumentException - */ - public static function start(Event $event): void - { - $command = self::buildCommand($event, self::DOCKER_START_INSTRUCTION); - exec($command); - - } - - /** - * @param Event $event Nom de l'événement - * @return void - * @throws DockerPilotInvalidArgumentException - */ - public static function down(Event $event): void - { - $command = self::buildCommand($event, self::DOCKER_DOWN_INSTRUCTION); - exec($command); - } - -} diff --git a/src/EduFramework/Scripts/Exception/DockerPilotInvalidArgumentException.php b/src/EduFramework/Scripts/Exception/DockerPilotInvalidArgumentException.php deleted file mode 100644 index c041969..0000000 --- a/src/EduFramework/Scripts/Exception/DockerPilotInvalidArgumentException.php +++ /dev/null @@ -1,12 +0,0 @@ -, available engines are : 'mysql' or 'maria-db'"; -}