Maha Bouchiba преди 2 години
родител
ревизия
021d16c80b
променени са 7 файла, в които са добавени 192 реда и са изтрити 22 реда
  1. 7 0
      .env.skeleton
  2. 13 0
      README.md
  3. 85 20
      docker-compose.yml
  4. 7 2
      docker/maestro/Dockerfile
  5. 3 0
      docker/nginx-proxy/certs/ssl_keys.sh
  6. 59 0
      docker/nginx/site_maestro.conf
  7. 18 0
      docker/nuxt_common/Dockerfile

+ 7 - 0
.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

+ 13 - 0
README.md

@@ -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`
 
@@ -305,6 +307,17 @@ Puis lancer :
     yarn install
     ln -s .env.docker .env
 
+#### Docker Poratil V2
+
+Se connecter au docker:
+
+    docker exec -it portail_v2 bash
+
+Puis lancer :
+
+    yarn install
+    ln -s .env.docker .env
+
 
 #### Docker typo3
 

+ 85 - 20
docker-compose.yml

@@ -97,6 +97,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
@@ -282,6 +322,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
@@ -335,6 +398,8 @@ services:
     depends_on:
       - nginx_new
 
+
+
   typo3:
     hostname: typo3
     container_name: typo3
@@ -365,26 +430,26 @@ services:
     depends_on:
       - nginx
 
-  adminassos:
-     hostname: v59
-     container_name: adminassos
-     build:
-       context: .
-       dockerfile: docker/adminassos/Dockerfile
-       args:
-         - OS=${OS}
-     restart: always
-     volumes:
-       - ./apps/opentalent:/var/source/opentalent:cached
-       - useruploaddata:/var/www/opentalent/fileadmin/user_upload:cached
-       - ./apps/vendor:/var/source/vendor:delegated
-       - ./apps/opentalent-config:/var/source/config:cached
-     environment:
-       - VIRTUAL_HOST=${V59_VIRTUAL_HOST}
-     networks:
-       - network
-     depends_on:
-       - nginx
+  # adminassos:
+  #    hostname: v59
+  #    container_name: adminassos
+  #    build:
+  #      context: .
+  #      dockerfile: docker/adminassos/Dockerfile
+  #      args:
+  #        - OS=${OS}
+  #    restart: always
+  #    volumes:
+  #      - ./apps/opentalent:/var/source/opentalent:cached
+  #      - useruploaddata:/var/www/opentalent/fileadmin/user_upload:cached
+  #      - ./apps/vendor:/var/source/vendor:delegated
+  #      - ./apps/opentalent-config:/var/source/config:cached
+  #    environment:
+  #      - VIRTUAL_HOST=${V59_VIRTUAL_HOST}
+  #    networks:
+  #      - network
+  #    depends_on:
+  #      - nginx
 
   metabase:
     hostname: metabase

+ 7 - 2
docker/maestro/Dockerfile

@@ -56,7 +56,9 @@ RUN     docker-php-ext-configure intl \
             bcmath  \
             calendar  \
             gd  \
-            tidy
+            tidy \
+            xml 
+          
 RUN     docker-php-ext-enable intl
 RUN     docker-php-ext-enable exif
 RUN     docker-php-ext-enable tidy
@@ -72,8 +74,11 @@ RUN php -r "copy('https://getcomposer.org/installer', '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
+WORKDIR /var/www/html

+ 3 - 0
docker/nginx-proxy/certs/ssl_keys.sh

@@ -72,4 +72,7 @@ cp docker/nginx-proxy/certs/default.crt docker/nginx-proxy/certs/local.portail_v
 
 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

+ 59 - 0
docker/nginx/site_maestro.conf

@@ -0,0 +1,59 @@
+server {
+    server_name local.maestro.opentalent.fr;
+    root /var/www/html/public;
+
+    location / {
+        add_header 'Access-Control-Allow-Origin' '*';
+
+        # 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