github.com/drud/ddev@v1.21.5-alpha1.0.20230226034409-94fcc4b94453/pkg/util/testdata/TestYamlFileToMap/app.yaml (about)

     1  # This file describes an application. You can have multiple applications
     2  # in the same project.
     3  #
     4  # See https://docs.platform.sh/configuration/app.html
     5  
     6  # The name of this app. Must be unique within a project.
     7  name: 'app'
     8  
     9  # The runtime the application uses.
    10  type: 'php:7.4'
    11  
    12  runtime:
    13    extensions:
    14      - redis
    15  
    16  # The relationships of the application with services or other applications.
    17  #
    18  # The left-hand side is the name of the relationship as it will be exposed
    19  # to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
    20  # side is in the form `<service name>:<endpoint name>`.
    21  relationships:
    22      database: 'db:mysql'
    23  
    24  # The size of the persistent disk of the application (in MB).
    25  disk: 2048
    26  
    27  # The 'mounts' describe writable, persistent filesystem mounts in the application.
    28  mounts:
    29      # The default Drupal files directory.
    30      '/web/sites/default/files':
    31          source: local
    32          source_path: 'files'
    33      # Drupal gets its own dedicated tmp directory. The settings.platformsh.php
    34      # file will automatically configure Drupal to use this directory.
    35      '/tmp':
    36          source: local
    37          source_path: 'tmp'
    38      # Private file uploads are stored outside the web root. The settings.platformsh.php
    39      # file will automatically configure Drupal to use this directory.
    40      '/private':
    41          source: local
    42          source_path: 'private'
    43      # Drush needs a scratch space for its own caches.
    44      '/.drush':
    45          source: local
    46          source_path: 'drush'
    47      # Drush will try to save backups to this directory, so it must be
    48      # writeable even though you will almost never need to use it.
    49      '/drush-backups':
    50          source: local
    51          source_path: 'drush-backups'
    52      # Drupal Console will try to save backups to this directory, so it must be
    53      # writeable even though you will almost never need to use it.
    54      '/.console':
    55          source: local
    56          source_path: 'console'
    57  
    58  # Configuration of the build of this application.
    59  build:
    60      # Automatically run `composer install` on every build.
    61      flavor: composer
    62  
    63  # The hooks executed at various points in the lifecycle of the application.
    64  hooks:
    65      # The build hook runs after Composer to finish preparing up your code.
    66      # No services are available but the disk is writeable.
    67      build: |
    68          set -e
    69      # The deploy hook runs after your application has been deployed and started.
    70      # Code cannot be modified at this point but the database is available.
    71      # The site is not accepting requests while this script runs so keep it
    72      # fast.
    73      deploy: |
    74          set -e
    75          php ./drush/platformsh_generate_drush_yml.php
    76          cd web
    77          drush -y cache-rebuild
    78          drush -y updatedb
    79          drush -y config-import
    80  
    81  # The configuration of app when it is exposed to the web.
    82  web:
    83      locations:
    84          # All requests not otherwise specified follow these rules.
    85          '/':
    86              # The folder from which to serve static assets, for this location.
    87              #
    88              # This is a filesystem path, relative to the application root.
    89              root: 'web'
    90  
    91              # How long to allow static assets from this location to be cached.
    92              #
    93              # Can be a time in seconds, or -1 for no caching. Times can be
    94              # suffixed with "s" (seconds), "m" (minutes), "h" (hours), "d"
    95              # (days), "w" (weeks), "M" (months, as 30 days) or "y" (years, as
    96              # 365 days).
    97              expires: 5m
    98  
    99              # Redirect any incoming request to Drupal's front controller.
   100              passthru: '/index.php'
   101  
   102              # Deny access to all static files, except those specifically allowed below.
   103              allow: false
   104  
   105              # Rules for specific URI patterns.
   106              rules:
   107                  # Allow access to common static files.
   108                  '\.(jpe?g|png|gif|svgz?|css|js|map|ico|bmp|eot|woff2?|otf|ttf)$':
   109                      allow: true
   110                  '^/robots\.txt$':
   111                      allow: true
   112                  '^/sitemap\.xml$':
   113                      allow: true
   114  
   115                  # Deny direct access to configuration files.
   116                  '^/sites/sites\.php$':
   117                      scripts: false
   118                  '^/sites/[^/]+/settings.*?\.php$':
   119                      scripts: false
   120  
   121          # The files directory has its own special configuration rules.
   122          '/sites/default/files':
   123              # Allow access to all files in the public files directory.
   124              allow: true
   125              expires: 5m
   126              passthru: '/index.php'
   127              root: 'web/sites/default/files'
   128  
   129              # Do not execute PHP scripts from the writeable mount.
   130              scripts: false
   131  
   132              rules:
   133                  # Provide a longer TTL (2 weeks) for aggregated CSS and JS files.
   134                  '^/sites/default/files/(css|js)':
   135                      expires: 2w
   136