Prechádzať zdrojové kódy

Merge branch 'master' of git@gitlab.2iopenservice.com:vincent/docker.git

Olivier Massot 4 rokov pred
rodič
commit
5028246a1e

+ 1 - 1
.env.skeleton

@@ -2,7 +2,7 @@
 OS=MAC
 
 #Composer hash for instal (check validity here : https://getcomposer.org/download/)
-COMPOSER_HASH=e5325b19b381bfd88ce90a5ddb7823406b2a38cff6bb704b0acc289a09c8128d4a8ce2bbafcd1fcbdc38666422fe2806
+COMPOSER_HASH=756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3
 
 #LetsEncrypt
 EMAIL=vincent.guffon@2iopenservice.com

+ 6 - 6
docker-compose.yaml

@@ -88,18 +88,18 @@ services:
     image: nginx:alpine
     volumes:
       - ./apps/api/public:/var/www/html/public:cached
-      - ./docker/nginx/site_php74.conf:/etc/nginx/conf.d/default.conf:cached
+      - ./docker/nginx/site_php8.conf:/etc/nginx/conf.d/default.conf:cached
     environment:
       - VIRTUAL_HOST=${API_NEW_VIRTUAL_HOST}
     depends_on:
-      - php74
+      - php8
 
-  php74:
+  php8:
     hostname: api
-    container_name: php74
+    container_name: php8
     build:
       context: .
-      dockerfile: docker/php7.4/Dockerfile
+      dockerfile: docker/php8/Dockerfile
       args:
         - COMPOSER_HASH=${COMPOSER_HASH}
         - OS=${OS}
@@ -361,7 +361,7 @@ services:
       - VIRTUAL_PORT=${BLACK_FIRE_PORT}
     depends_on:
       - php70
-      - php74
+      - php8
 
   phpdoc:
     hostname: phpdoc

+ 60 - 0
docker/nginx/site_php8.conf

@@ -0,0 +1,60 @@
+server {
+    server_name local.new.api.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)
+    # location /bundles {
+    #     try_files $uri =404;
+    # }
+
+    proxy_buffer_size 128k;
+    proxy_buffers 4 256k;
+    proxy_busy_buffers_size 256k;
+
+    location ~ ^/index\.php(/|$) {
+        fastcgi_pass php8: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;
+}

+ 4 - 4
docker/php7.4/Dockerfile → docker/php8/Dockerfile

@@ -1,5 +1,5 @@
 # ./docker/php/Dockerfile
-FROM php:7.4-fpm
+FROM php:8.0.10-fpm
 
 ARG COMPOSER_HASH
 ARG OS
@@ -53,9 +53,9 @@ RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
 
 ######## Php conf ########
 COPY /.ssh /root/.ssh
-COPY /docker/php7.4/conf/memory.ini /usr/local/etc/php/conf.d
-COPY /docker/php7.4/conf/apc.ini /usr/local/etc/php/conf.d
-COPY /docker/php7.4/conf/execution_time.ini /usr/local/etc/php/conf.d
+COPY /docker/php8/conf/memory.ini /usr/local/etc/php/conf.d
+COPY /docker/php8/conf/apc.ini /usr/local/etc/php/conf.d
+COPY /docker/php8/conf/execution_time.ini /usr/local/etc/php/conf.d
 ######## FACL and Start ########
 
 WORKDIR /var/www/html

+ 0 - 0
docker/php7.4/conf/apc.ini → docker/php8/conf/apc.ini


+ 0 - 0
docker/php7.4/conf/execution_time.ini → docker/php8/conf/execution_time.ini


+ 0 - 0
docker/php7.4/conf/memory.ini → docker/php8/conf/memory.ini


+ 0 - 0
docker/php7.4/conf/xdebug.ini → docker/php8/conf/xdebug.ini


+ 0 - 0
docker/php7.4/jwt/private.pem → docker/php8/jwt/private.pem


+ 0 - 0
docker/php7.4/jwt/public.pem → docker/php8/jwt/public.pem