Bläddra i källkod

Merge branch 'V8-4977-renommer-agenda' into 'master'

V8 4977 renommer agenda

See merge request opentalent/docker!2
Maha Bouchiba 2 år sedan
förälder
incheckning
e1b8f8c864

+ 12 - 5
.env.skeleton

@@ -21,6 +21,13 @@ ES_PORT=9200
 API_VIRTUAL_HOST=local.api.opentalent.fr
 AP2I_VIRTUAL_HOST=local.ap2i.opentalent.fr
 
+#MAESTRO
+MAESTRO_VIRTUAL_HOST=local.maestro.opentalent.fr
+
+#NUXT_COMMON
+NUXT_COMMON_VIRTUAL_HOST=local.nuxt_common.opentalent.fr
+NUXT_COMMON_PORT=3006
+
 #ADMIN
 ADMIN_VIRTUAL_HOST=local.admin.opentalent.fr
 ADMIN_PORT=3000
@@ -41,12 +48,12 @@ FRAMES_VIRTUAL_HOST=local.frames.opentalent.fr
 FRAMES_PORT=3004
 FRAMES_REPORT_PORT=3005
 
-#FRAMES_V3
-FRAMES_V3_VIRTUAL_HOST=local.frames_v3.opentalent.fr
-FRAMES_V3_PORT=3000
+#AGENDA
+AGENDA_VIRTUAL_HOST=local.agenda.opentalent.fr
+AGENDA_PORT=3000
 
-#PORTAIL-V2
-PORTAIL_V2_VIRTUAL_HOST=local.portail-v2.opentalent.fr
+#PORTAIL_V2
+PORTAIL_V2_VIRTUAL_HOST=local.portail_v2.opentalent.fr
 PORTAIL_V2_PORT=3000
 
 #V59

+ 8 - 9
Makefile.skeleton

@@ -1,8 +1,8 @@
-# Ce Makefile permet de lancer les containers docker et les applications frames
-# et frames_v3 en même temps (véirfier que le port 3019 est libre)
-.PHONY: all launch_containers frames frames_v3 db_watch
+# Ce Makefile permet de lancer les containers docker et les applications frames / agenda
+# et agenda en même temps (véirfier que le port 3019 est libre)
+.PHONY: all launch_containers frames agenda db_watch
 
-launch: launch_containers frames frames_v3 db_watch  
+launch: launch_containers frames agenda db_watch  
 
 launch_containers:
 	docker-compose up -d
@@ -10,11 +10,10 @@ launch_containers:
 frames:
 	docker exec -d frames bash -c "yarn dev"
 
-frames_v3:
-	docker exec -d frames_v3 bash -c "yarn dev"
+agenda:
+	docker exec -d agenda bash -c "yarn dev"
 
 db_watch:
-	cd apps/frames_v3 && json-server db.json --watch --port 3019 
+	cd appsagenda && json-server db.json --watch --port 3019 
 
-# frames_v3 : https://local.frames_v3.opentalent.fr
-# frames : https://local.frames.opentalent.fr/
+# agenda : https://local.agenda.opentalent.fr

+ 35 - 5
README.md

@@ -44,7 +44,7 @@ Les repositories suivants doivent être clônés dans les sous-répertoires suiv
 | apps/metabase               | [Voir le repository](https://gitlab.2iopenservice.com/vincent/metabase)               | git@gitlab.2iopenservice.com:vincent/metabase.git               |
 | apps/python-scripts/clonedb | [Voir le repository](https://gitlab.2iopenservice.com/opentalent/clonedb)             | git@gitlab.2iopenservice.com:opentalent/clonedb.git             |
 | apps/frames                 | [Voir le repository](https://gitlab.2iopenservice.com/opentalent/frames)              | git@gitlab.2iopenservice.com:opentalent/frames.git              |
-| apps/frames_v3              | [Voir le repository](https://gitlab.2iopenservice.com/opentalent/frames_v3)           | git@gitlab.2iopenservice.com:opentalent/frames_v3.git           |
+| apps/agenda             | [Voir le repository](https://gitlab.2iopenservice.com/opentalent/agenda)           | git@gitlab.2iopenservice.com:opentalent/agenda.git           |
 | apps/ap2i                   | [Voir le repository](https://gitlab.2iopenservice.com/opentalent/ap2i)                | git@gitlab.2iopenservice.com:opentalent/ap2i.git                |
 | apps/ap2i-doc               | [Voir le repository](https://gitlab.2iopenservice.com/vincent/ap2i-doc)               | git@gitlab.2iopenservice.com:vincent/ap2i-doc.git               |
 | apps/app                    | [Voir le repository](https://gitlab.2iopenservice.com/opentalent/app)                 | git@gitlab.2iopenservice.com:opentalent/app.git                 |
@@ -85,7 +85,7 @@ Pour cela, ajouter les lignes suivantes à votre fichier `/etc/hosts`:
     127.0.0.1 local.opentalent.fr   # Docker 'portail'
     127.0.0.1 local.sub.opentalent.fr   # Docker 'typo3'
     127.0.0.1 local.frames.opentalent.fr   # Docker 'frames'
-    127.0.0.1 local.frames_v3.opentalent.fr   # Docker 'frames_v3'
+    127.0.0.1 local.agenda.opentalent.fr   # Docker 'agenda'
     127.0.0.1 local.blackfire.opentalent.fr   # Docker 'blackfire'
     127.0.0.1 local.metabase.opentalent.fr   # Docker 'metabase'
     127.0.0.1 local.ap2i.opentalent.fr   # Docker 'ap2i-doc'
@@ -95,6 +95,8 @@ Pour cela, ajouter les lignes suivantes à votre fichier `/etc/hosts`:
     127.0.0.1 local.app-v3.opentalent.fr   # Docker 'app-v3'    
     127.0.0.1 local.mercure.opentalent.fr   # Docker 'mercure'
     127.0.0.1 local.portail-v2.opentalent.fr    # Docker 'portail-v2'
+    127.0.0.1 local.maestro.opentalent.fr    # Docker 'maestro'
+    127.0.0.1 local.nuxt_common.opentalent.fr    # Docker 'nuxt_common'
 
 > Attention: les domaines indiqués ici doivent correspondre aux domaines définis dans le fichier `.env`
 
@@ -282,11 +284,22 @@ Puis lancer :
     ln -s .env.docker .env
 
 
-#### Docker Frames V3
+#### Docker agenda
 
 Se connecter au docker:
 
-    docker exec -it frames_v3 bash
+    docker exec -it agenda bash
+
+Puis lancer :
+
+    yarn install
+    ln -s .env.docker .env
+
+#### Docker Poratil V2
+
+Se connecter au docker:
+
+    docker exec -it portail_v2 bash
 
 Puis lancer :
 
@@ -316,6 +329,23 @@ Exécuter :
 
     pip3 install -r requirements.txt
 
+#### Docker maestro
+
+Se connecter au docker:
+
+    docker exec -it maestro bash
+
+Puis lancer :
+  
+  symfony console d:d:c
+  symfony console d:m:m
+  symfony console d:f:l
+  symfony console serve -d
+
+Connexion : 
+   user:     admin@mail.fr
+   mdp:      admin
+
 #### (optionnel) Docker phpdoc
 
 Pour générer la PHP-DOC de l'API :
@@ -565,7 +595,7 @@ Ainsi configuré, le docker sera joignable sur le réseau interne à l'adresse `
 | app         | app         | O            | 172.20.2.2 | 3002:3000, 3003:3003   | local.app.opentalent.fr / 3002           | -                                                     |
 | app_v3      | app_v3      | O            | 172.20.2.3 | 3009:3000, 24678:24678 | local.app-v3.opentalent.fr / 3000        | -                                                     |
 | frames      | frames      | O            | 172.20.2.4 | 3004:3004, 3005:3005   | local.frames.opentalent.fr / 3004        | -                                                     |
-| frames_v3   | frames_v3   | O            | 172.20.2.5 | 3007:3000, 24679:24679 | local.frames-v3.opentalent.fr / 3000     | -                                                     |
+| agenda      | agenda  | O            | 172.20.2.5 | 3007:3000, 24679:24679 | local.agenda.opentalent.fr / 3000     | -                                                     |
 | portail     | portail     | O            | -          | -                      | local.opentalent.fr                      | -                                                     |
 | portail_v2  | portail_v2  | O            | 172.20.2.6 | 3010:3000, 24680:24680 | local.portail-v2.opentalent.fr / 3000    | -                                                     |
 | typo3       | typo3       | O            | 172.20.3.1 | -                      | local.sub.opentalent.fr                  | docker.sub.opentalent.fr,  docker.sub.customdomain.fr |

+ 73 - 7
docker-compose.yml

@@ -96,6 +96,46 @@ services:
     depends_on:
       - ap2i
 
+  nginx_maestro:
+    hostname: nginx_maestro
+    container_name: nginx_maestro
+    image: nginx:alpine
+    volumes:
+      - ./apps/maestro/public:/var/www/html/public:cached
+      - ./docker/nginx/site_maestro.conf:/etc/nginx/conf.d/default.conf:cached
+    environment:
+      - VIRTUAL_HOST=${MAESTRO_VIRTUAL_HOST}
+    networks:
+      - network
+    depends_on:
+      - maestro
+
+  maestro:
+    hostname: maestro
+    container_name: maestro
+    build:
+      context: .
+      dockerfile: docker/maestro/Dockerfile
+      args:
+        - COMPOSER_HASH=${COMPOSER_HASH}
+        - OS=${OS}
+        - HOST=${HOST}
+    restart: always
+    environment:
+      - PHP_IDE_CONFIG=serverName=maestro
+      - HTTPS_METHOD=noredirect
+      - APP_ENV=dev
+      - APP_DEBUG=1
+    volumes:
+      - ./apps/maestro:/var/www/html:rw,cached
+      - appcache:/var/www/html/var/cache
+      - applog:/var/www/html/var/logs
+    networks:
+      network:
+        ipv4_address: 172.20.1.8
+    depends_on:
+      - nginx-proxy
+
   ap2i:
     hostname: ap2i
     container_name: ap2i
@@ -230,21 +270,22 @@ services:
     depends_on:
       - nginx_new
 
-  frames_v3:
-    hostname: frames_v3
-    container_name: frames_v3
+  agenda:
+    hostname: agenda
+    container_name: agenda
     build:
       context: .
-      dockerfile: docker/frames_v3/Dockerfile
+      dockerfile: docker/agenda/Dockerfile
     volumes:
-      - ./apps/frames_v3:/home/workspace:rw,cached
+      - ./apps/agenda:/home/workspace:rw,cached
+      - ./apps/nuxt_common:/home/workspace/nuxt_common:rw,cached
     tty: true
     ports:
       - "3007:3000"
       - "24679:24679"
     environment:
-      - VIRTUAL_HOST=${FRAMES_V3_VIRTUAL_HOST}
-      - VIRTUAL_PORT=${FRAMES_V3_PORT}
+      - VIRTUAL_HOST=${AGENDA_VIRTUAL_HOST}
+      - VIRTUAL_PORT=${AGENDA_PORT}
       - NODE_ENV=development
       - HTTPS_METHOD=noredirect
     networks:
@@ -253,6 +294,29 @@ services:
     depends_on:
       - nginx_new
 
+  nuxt_common:
+    hostname: nuxt_common
+    container_name: nuxt_common
+    build:
+      context: .
+      dockerfile: docker/nuxt_common/Dockerfile
+    volumes:
+      - ./apps/nuxt_common:/home/workspace:rw,cached
+    tty: true
+    ports:
+      - "3006:3000"
+      - "24669:24669"
+    environment:
+      - VIRTUAL_HOST=${NUXT_COMMON_VIRTUAL_HOST}
+      - VIRTUAL_PORT=${NUXT_COMMON_PORT}
+      - NODE_ENV=development
+      - HTTPS_METHOD=noredirect
+    networks:
+      network:
+        ipv4_address: 172.20.2.9
+    depends_on:
+      - nginx_new
+
   portail:
     hostname: portail
     container_name: portail
@@ -306,6 +370,8 @@ services:
     depends_on:
       - nginx_new
 
+
+
   typo3:
     hostname: typo3
     container_name: typo3

+ 0 - 0
docker/frames_v3/.gitignore → docker/agenda/.gitignore


+ 18 - 0
docker/agenda/Dockerfile

@@ -0,0 +1,18 @@
+FROM node:18.10-buster
+
+ENV WORKDIR /home/workspace
+
+RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
+    && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
+
+
+RUN apt-get update && apt-get install -y g++ build-essential yarn
+
+# Cypress requirements (https://docs.cypress.io/guides/getting-started/installing-cypress#Ubuntu-Debian)
+RUN apt-get update && apt-get install -y --fix-missing libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 \
+                       libnss3 libxss1 libasound2 libxtst6 xauth xvfb
+
+# Define working directory.
+WORKDIR ${WORKDIR}
+
+CMD node

+ 0 - 15
docker/frames_v3/Dockerfile

@@ -1,15 +0,0 @@
-    # Pull base image.
-FROM node:18.10-buster
-
-ENV WORKDIR /home/workspace
-
-RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
-    echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
-
-
-RUN apt-get update && apt-get install -y g++ build-essential yarn
-
-# Define working directory.
-WORKDIR ${WORKDIR}
-
-CMD node

+ 84 - 0
docker/maestro/Dockerfile

@@ -0,0 +1,84 @@
+# ./docker/php/Dockerfile
+FROM php:8.2.1-fpm
+
+ARG COMPOSER_HASH
+ARG OS
+ARG DEBIAN_FRONTEND=noninteractive
+
+RUN apt-get update && apt-get install -y --fix-missing \
+    apt-utils \
+    gnupg
+
+## Si erreur de PUBKEY :
+RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E9C74FEEA2098A6E
+
+RUN echo "deb https://packages.dotdeb.org jessie all" >> /etc/apt/sources.list
+RUN echo "deb-src https://packages.dotdeb.org jessie all" >> /etc/apt/sources.list
+
+RUN apt-get clean
+RUN apt-get update
+RUN apt-get install --fix-missing --no-install-recommends -y \
+          zlib1g-dev libicu-dev g++ \
+          libjpeg62-turbo-dev \
+          libzip-dev \
+          libpng-dev \
+          libtidy-dev \
+          libssl-dev \
+          libxslt-dev \
+          libxrender-dev  \
+          libxrender1 \
+          libxt6 \
+          libxtst6 \
+          openssh-server \
+          build-essential \
+          xorg \
+          iputils-ping \
+          wget \
+          gdebi \
+          ca-certificates \
+          wget \
+          xz-utils \
+          fontconfig \
+          git \
+          nano \
+          acl \
+          procps \
+          libmagickwand-dev \
+          imagemagick \
+          zip
+
+RUN     docker-php-ext-configure intl \
+        && docker-php-ext-install  \
+            intl  \
+            opcache  \
+            pdo_mysql \
+            exif \
+            bcmath  \
+            calendar  \
+            gd  \
+            tidy \
+            xml 
+          
+RUN     docker-php-ext-enable intl
+RUN     docker-php-ext-enable exif
+RUN     docker-php-ext-enable tidy
+RUN     docker-php-ext-install zip
+RUN     docker-php-ext-install xsl
+
+        ## APCU
+RUN     pecl install apcu-5.1.21
+
+## COMPOSER
+RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"; \
+    php composer-setup.php; \
+    php -r "unlink('composer-setup.php');"; \
+    mv composer.phar /usr/local/bin/composer
+
+## Symfony CLI
+RUN wget https://get.symfony.com/cli/installer -O - | bash
+RUN mv $(find / -name symfony) /usr/local/bin/symfony
+
+## Create .env.local file
+RUN echo "APP_ENV=docker" > .env.local
+
+WORKDIR /var/www/html

+ 8 - 2
docker/nginx-proxy/certs/ssl_keys.sh

@@ -58,8 +58,8 @@ cp docker/nginx-proxy/certs/default.crt docker/nginx-proxy/certs/local.app-doc.o
 cp docker/nginx-proxy/certs/default.key docker/nginx-proxy/certs/local.frames.opentalent.fr.key
 cp docker/nginx-proxy/certs/default.crt docker/nginx-proxy/certs/local.frames.opentalent.fr.crt
 
-cp docker/nginx-proxy/certs/default.key docker/nginx-proxy/certs/local.frames_v3.opentalent.fr.key
-cp docker/nginx-proxy/certs/default.crt docker/nginx-proxy/certs/local.frames_v3.opentalent.fr.crt
+cp docker/nginx-proxy/certs/default.key docker/nginx-proxy/certs/local.agenda.opentalent.fr.key
+cp docker/nginx-proxy/certs/default.crt docker/nginx-proxy/certs/local.agenda.opentalent.fr.crt
 
 cp docker/nginx-proxy/certs/default.key docker/nginx-proxy/certs/local.mercure.opentalent.fr.key
 cp docker/nginx-proxy/certs/default.crt docker/nginx-proxy/certs/local.mercure.opentalent.fr.crt
@@ -69,4 +69,10 @@ cp docker/nginx-proxy/certs/default.key docker/nginx-proxy/certs/local.app-v3.op
 
 cp docker/nginx-proxy/certs/default.key docker/nginx-proxy/certs/local.portail_v2.opentalent.fr.key
 cp docker/nginx-proxy/certs/default.crt docker/nginx-proxy/certs/local.portail_v2.opentalent.fr.crt
+
+cp docker/nginx-proxy/certs/default.key docker/nginx-proxy/certs/local.maestro.opentalent.fr.key
+cp docker/nginx-proxy/certs/default.crt docker/nginx-proxy/certs/local.maestro.opentalent.fr.crt
+
+cp docker/nginx-proxy/certs/default.key docker/nginx-proxy/certs/local.nuxt_common.opentalent.fr.key
+cp docker/nginx-proxy/certs/default.crt docker/nginx-proxy/certs/local.nuxt_common.opentalent.fr.crt
 #docker-compose build --no-cache nginx-proxy

+ 64 - 0
docker/nginx/site_maestro.conf

@@ -0,0 +1,64 @@
+server {
+    server_name local.maestro.opentalent.fr;
+    root /var/www/html/public;
+
+    location / {
+          add_header 'Access-Control-Allow-Origin' '*';
+    location /api/images {
+        alias /var/www/html/public/uploads/news;
+        expires 30d;
+        add_header Cache-Control "public, max-age=2592000";
+    }
+
+        # try to serve file directly, fallback to index.php
+        try_files $uri /index.php$is_args$args;
+    }
+
+    # optionally disable falling back to PHP script for the asset directories;
+    # nginx will return a 404 error when files are not found instead of passing the
+    # request to Symfony (improves performance but Symfony's 404 page is not displayed)
+    #     try_files $uri =404;
+    # }
+
+    proxy_buffer_size 128k;
+    proxy_buffers 4 256k;
+    proxy_busy_buffers_size 256k;
+
+    location ~ ^/index\.php(/|$) {
+        fastcgi_pass maestro:9000;
+        fastcgi_split_path_info ^(.+\.php)(/.*)$;
+        include fastcgi_params;
+
+        fastcgi_buffer_size 128k;
+        fastcgi_buffers 4 256k;
+        fastcgi_busy_buffers_size 256k;
+
+        # optionally set the value of the environment variables used in the application
+        # fastcgi_param APP_ENV prod;
+        # fastcgi_param APP_SECRET <app-secret-id>;
+        # fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";
+
+        # When you are using symlinks to link the document root to the
+        # current version of your application, you should pass the real
+        # application path instead of the path to the symlink to PHP
+        # FPM.
+        # Otherwise, PHP's OPcache may not properly detect changes to
+        # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
+        # for more information).
+        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
+        fastcgi_param DOCUMENT_ROOT $realpath_root;
+        # Prevents URIs that include the front controller. This will 404:
+        # http://domain.tld/index.php/some-path
+        # Remove the internal directive to allow URIs like this
+        internal;
+    }
+
+    # return 404 for all other php files not matching the front controller
+    # this prevents access to other php files you don't want to be accessible.
+    location ~ \.php$ {
+        return 404;
+    }
+
+    error_log /var/log/nginx/project_error.log;
+    access_log /var/log/nginx/project_access.log;
+}

+ 18 - 0
docker/nuxt_common/Dockerfile

@@ -0,0 +1,18 @@
+FROM node:18.10-buster
+
+ENV WORKDIR /home/workspace
+
+RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
+    && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
+
+
+RUN apt-get update && apt-get install -y g++ build-essential yarn
+
+# Cypress requirements (https://docs.cypress.io/guides/getting-started/installing-cypress#Ubuntu-Debian)
+RUN apt-get update && apt-get install -y --fix-missing libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 \
+                       libnss3 libxss1 libasound2 libxtst6 xauth xvfb
+
+# Define working directory.
+WORKDIR ${WORKDIR}
+
+CMD node