Skip to content

Instantly share code, notes, and snippets.

@sorenmalling
Created October 18, 2021 13:47
Show Gist options
  • Save sorenmalling/1603c73b6b94b1f317c41f7a329deec8 to your computer and use it in GitHub Desktop.
Save sorenmalling/1603c73b6b94b1f317c41f7a329deec8 to your computer and use it in GitHub Desktop.
name: app
type: php:7.4
dependencies:
php:
composer/composer: '^2'
runtime:
extensions:
- redis
# Composer build tasks run prior to build hook, which runs
# composer --no-ansi --no-interaction install --no-progress --prefer-dist --optimize-autoloader
build:
flavor: composer
relationships:
# MariaDB/MySQL will then be accessible to the app from 'database' relationship.
# The service name `db` must match the top-level attribute in `.platform/services.yaml`.
database: 'db:mysql'
# Redis will then be accessible to the app from 'rediscache' relationship.
# The service name `cache` must match the top-level attribute in `.platform/services.yaml`.
rediscache: 'cache:redis'
# The configuration of app when it is exposed to the web.
web:
locations:
'/':
root: 'public'
passthru: '/index.php'
index:
- 'index.php'
allow: false
# Rules for specific URI patterns.
rules:
# Allow access to common static files.
'\.(jpe?g|png|gif|svgz?|css|js|map|ico|bmp|eot|woff2?|otf|ttf)$':
allow: true
expires: 4w
'^/robots\.txt$':
allow: true
'^/sitemap\.xml$':
allow: true
'/typo3':
root: 'public/typo3'
passthru: '/typo3/index.php'
index:
- 'index.php'
allow: false
rules:
# Allow access to common static files.
'\.(jpe?g|png|gif|svgz?|css|js|map|ico|bmp|eot|woff2?|otf|ttf)$':
allow: true
expires: 4w
'/fileadmin':
root: 'public/fileadmin'
scripts: false
allow: true
passthru: '/index.php'
rules:
# Allow access to common static files.
'\.(jpe?g|png|gif|svgz?|css|js|map|ico|bmp|eot|woff2?|otf|ttf)$':
allow: true
expires: 4w
'/typo3temp/assets':
root: 'public/typo3temp/assets'
scripts: false
allow: true
passthru: '/index.php'
expires: 4w
'/typo3conf/LocalConfiguration.php':
allow: false
'/typo3conf/AdditionalConfiguration.php':
allow: false
# The size of the persistent disk of the application (in MB).
disk: 2048
# The 'mounts' describe writable, persistent filesystem mounts in the application.
mounts:
"public/typo3temp":
source: local
source_path: "typo3temp"
"public/fileadmin":
source: local
source_path: "fileadmin"
"var/cache":
source: local
source_path: "var-cache"
"var/charset":
source: local
source_path: "var-charset"
"var/lock":
source: local
source_path: "var-lock"
"var/log":
source: local
source_path: "var-log"
"var/transient":
source: local
source_path: "var-transient"
# The hooks that will be performed when the package is deployed.
hooks:
# The build hook runs after Composer to finish preparing up your code.
# No services are available but the disk is writeable.
build: |
# Exit hook immediately if a command exits with a non-zero status.
set -e
# Enable the install tool for 60mins after deployment.
touch public/typo3conf/ENABLE_INSTALL_TOOL
# Clean up the FIRST_INSTALL file, that was created.
if [ -f public/FIRST_INSTALL ]; then
rm public/FIRST_INSTALL
fi;
php vendor/bin/typo3 cache:flush --group di
php vendor/bin/typo3 cache:flush --group system
deploy: |
# Exit hook immediately if a command exits with a non-zero status.
set -e
php vendor/bin/typo3 extension:setup
php vendor/bin/typo3 cache:warmup
post_deploy:
php vendor/bin/typo3 cache:flush --group pages
crons:
# Run TYPO3's Scheduler tasks every 5 minutes.
typo3:
spec: "*/5 * * * *"
cmd: "vendor/bin/typo3 scheduler:run"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment