]> _ Git - fluidbook-toolbox.git/commitdiff
wip #6549 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 5 Dec 2023 13:15:43 +0000 (14:15 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 5 Dec 2023 13:15:43 +0000 (14:15 +0100)
app/Http/Controllers/Admin/Operations/Tools/DockerWebContainer.php
resources/tools/dockerwebcontainer/base
resources/tools/dockerwebcontainer/template/config/httpd/httpd.conf

index 07c428d80efe24ed3042c86c57de00a0c944e62e..8878950c56b8b71a7ddfffda3297422be23db228 100644 (file)
@@ -29,6 +29,7 @@ trait DockerWebContainer
         $form->addField('containername', Text::class, __('Nom du container'), ['prefix' => '/docker/']);
         $form->addField('domain', Text::class, __('Nom du domaine ou sous-domaine'), ['placeholder' => 'containername.dev.cubedesigners.com']);
         $form->addField('env', SelectFromArrayMultiple::class, __('Environnements'), ['default' => json_encode(['production', 'dev']), 'options' => ['production' => 'production', 'dev' => 'dev', 'staging' => 'staging', 'preprod' => 'preprod']]);
+        $form->addField('public', Checkbox::class, __('Racine dans le dossier "public"'), ['default' => true]);
         $form->addField('phpversion', SelectFromArray::class, __('Version de PHP'), ["options" =>
             ['none' => '-',
                 '5.6' => '5.6',
@@ -60,6 +61,9 @@ trait DockerWebContainer
             $subDomain = $env === 'production' ? 'www.' : $env . '.';
             $dockerSuffix = $env === 'production' ? '' : '-' . $env;
 
+            if (count($envs) === 1) {
+                $subDomain = '';
+            }
 
             $variables = ['$name' => $name . $dockerSuffix,
                 '$portadminer' => rand(10000, 60000),
@@ -74,6 +78,7 @@ trait DockerWebContainer
                 '$localeshort' => 'fr',
                 '$sshpassword' => Str::random(16),
                 '$fixrights' => '',
+                '$public' => $request->get('public') ? '/public' : '/'
             ];
 
             if (!$variables['$domain']) {
index d6a541f5490443ec4bf5908b5c112c07f2a1db59..d0c1802fc2ba74c91d12c319494987af67e2b087 100644 (file)
@@ -5,7 +5,7 @@ services:
         build: './images/httpd'
         working_dir: /application
         volumes:
-            - './www/public/:/usr/local/apache2/htdocs/'
+            - './www$public:/usr/local/apache2/htdocs'
             - './www/:/application/'
             - './config/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf'
         environment:
index 3195715fc78eb2e2be5fa1ea070589251673a03f..0fa8c8e3d60e0cdad07421183453f6031a206a87 100644 (file)
@@ -264,8 +264,8 @@ ServerAdmin you@example.com
 # documents. By default, all requests are taken from this directory, but
 # symbolic links and aliases may be used to point to other locations.
 #
-DocumentRoot "/application/public"
-<Directory "/application/public">
+DocumentRoot "/application$public"
+<Directory "/application$public">
     #
     # Possible values for the Options directive are "None", "All",
     # or any combination of:
@@ -293,7 +293,7 @@ DocumentRoot "/application/public"
     Require all granted
 </Directory>
 
-ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://$name:9000/application/public/$1" timeout=1800
+ProxyPassMatch ^/(.*\.php(/.*)?)$ "fcgi://$name:9000/application$public/$1" timeout=1800
 
 XSendFile on
 XSendFilePath /application