From 7924b94f4cadde72f46e83f7c389230ff2eb6edd Mon Sep 17 00:00:00 2001 From: Mohamed Menacer <mohamed.menacer@etu.univ-amu.fr> Date: Wed, 12 Mar 2025 02:19:40 +0100 Subject: [PATCH] final version --- .gitlab-ci.yml | 24 ----------------- compose.yaml | 2 +- docker/php/Dockerfile | 3 +-- migrations/Version20250312002806.php | 33 +++++++++++++++++++++++ src/Controller/RegistrationController.php | 2 +- 5 files changed, 36 insertions(+), 28 deletions(-) delete mode 100644 .gitlab-ci.yml create mode 100644 migrations/Version20250312002806.php diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 064637f..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,24 +0,0 @@ -image: docker:latest - -# Aucune utilisation de "docker:dind" -services: - - docker:19.03.12 - -variables: - DOCKER_DRIVER: overlay2 - COMPOSE_FILE: "docker-compose.yml" - DOCKER_HOST: "unix:///var/run/docker.sock" # Utilisation du socket Docker de l'hôte. - -stages: - - build - - test - - deploy - -before_script: - - export DOCKER_HOST="unix:///var/run/docker.sock" # Connexion à Docker sur l'hôte - -build: - stage: build - script: - - docker-compose -f $COMPOSE_FILE build - - docker-compose -f $COMPOSE_FILE up -d diff --git a/compose.yaml b/compose.yaml index 70d3c49..f5f03db 100644 --- a/compose.yaml +++ b/compose.yaml @@ -15,7 +15,7 @@ services: build: ./docker/nginx volumes: - ./public:/var/www/public:delegated - - ./docker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf + - ./docker/nginx/nginx.conf:/etc/nginx/default.conf ports: - "8000:80" depends_on: #sinon on sera pas interprété les requêtes diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index d27b8e6..0c64465 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -1,7 +1,6 @@ # l'image php c'est une image minimaliste qui ne va inclure toutes les extenctions importantes pour fonctionner avec Symphony # par exemple Ctype, iconv, simpleXML, Session .. - -FROM PHP:8.3-fpm-alpine +FROM php:8.3-fpm-alpine # install dependencies ' permet d installer des differentes dependances ' RUN apk --no-cache add curl git wget bash dpkg diff --git a/migrations/Version20250312002806.php b/migrations/Version20250312002806.php new file mode 100644 index 0000000..3be2103 --- /dev/null +++ b/migrations/Version20250312002806.php @@ -0,0 +1,33 @@ +<?php + +declare(strict_types=1); + +namespace DoctrineMigrations; + +use Doctrine\DBAL\Schema\Schema; +use Doctrine\Migrations\AbstractMigration; + +/** + * Auto-generated Migration: Please modify to your needs! + */ +final class Version20250312002806 extends AbstractMigration +{ + public function getDescription(): string + { + return ''; + } + + public function up(Schema $schema): void + { + // this up() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE TABLE `user` (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL COMMENT \'(DC2Type:json)\', password VARCHAR(255) NOT NULL, is_verified TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_IDENTIFIER_EMAIL (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', available_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', delivered_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_75EA56E0FB7336F0 (queue_name), INDEX IDX_75EA56E0E3BD61CE (available_at), INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP TABLE `user`'); + $this->addSql('DROP TABLE messenger_messages'); + } +} diff --git a/src/Controller/RegistrationController.php b/src/Controller/RegistrationController.php index 3e8a71f..77c0001 100644 --- a/src/Controller/RegistrationController.php +++ b/src/Controller/RegistrationController.php @@ -89,6 +89,6 @@ class RegistrationController extends AbstractController // @TODO Change the redirect on success and handle or remove the flash message in your templates $this->addFlash('success', 'Your email address has been verified.'); - return $this->redirectToRoute('app_register'); + return $this->redirectToRoute('app_login'); } } -- GitLab