Getting started
Prerequisites
Composer
Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.
Configure your app
The ideal .platform.app.yaml
file will vary from project project, and you are free to customize yours as needed. A recommended baseline TYPO3 configuration is listed below, and can also be found in our TYPO3 template project.
# This file describes an application. You can have multiple applications
# in the same project.
# The name of this app. Must be unique within a project.
name: app
# The type of the application to build.
type: php:7.0
build:
flavor: composer
runtime:
extensions:
- redis
- imagick
- xdebug
# The relationships of the application with services or other applications.
# The left-hand side is the name of the relationship as it will be exposed
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
# side is in the form `:`.
relationships:
database: 'mysqldb:mysql'
redis: 'rediscache:redis'
# The configuration of app when it is exposed to the web.
web:
locations:
'/':
# The public directory of the app, relative to its root.
# check if web convention
root: 'web'
passthru: '/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
'^/robots\.txt$':
allow: true
'^/sitemap\.xml$':
allow: true
'/uploads':
root: 'web/uploads'
scripts: false
allow: true
passthru: '/index.php'
'/fileadmin':
root: 'web/fileadmin'
scripts: false
allow: true
passthru: '/index.php'
'/typo3temp/assets':
root: 'web/typo3temp/assets'
scripts: false
allow: true
passthru: '/index.php'
rules:
'\.js\.gzip$':
headers:
Content-Type: text/javascript
Content-Encoding: gzip
'\.css\.gzip$':
headers:
Content-Type: text/css
Content-Encoding: gzip
'/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 that will be performed when the package is deployed.
mounts:
"web/typo3temp/assets": "shared:files/tmp-assets"
"web/typo3temp/var": "shared:files/tmp-var"
"web/uploads": "shared:files/uploads"
"web/fileadmin": "shared:files/fileadmin"
"web/typo3conf/writeable": "shared:files/config"
"web/typo3conf/l10n": "shared:files/l10n"
# The hooks that will be performed when the package is deployed.
hooks:
build: |
set -e
vendor/bin/typo3cms install:generatepackagestates --activate-default
if [ ! -f web/typo3conf/writeable/LocalConfiguration.php ]; then
cd web
touch FIRST_INSTALL
cd typo3conf
ln -sf writeable/LocalConfiguration.php LocalConfiguration.php
ln -sf writeable/ENABLE_INSTALL_TOOL ENABLE_INSTALL_TOOL
fi;
if [ ! -f /app/web/typo3conf/writeable/PackageStates.php ]; then
cd /app/web
cd typo3conf
ln -sf writeable/PackageStates.php PackageStates.php
fi;
deploy: |
set -e
if [ ! -f web/typo3conf/writeable/installed.lock ]; then
touch web/typo3conf/writeable/ENABLE_INSTALL_TOOL
cp web/typo3/sysext/core/Configuration/FactoryConfiguration.php web/typo3conf/writeable/LocalConfiguration.php
vendor/bin/typo3cms install:setup --non-interactive --admin-user-name='admin' --admin-password='password' --site-setup-type='none' --site-name='TYPO3 on Platform.sh' --skip-integrity-check
touch web/typo3conf/writeable/installed.lock
fi;
vendor/bin/typo3cms install:fixfolderstructure
vendor/bin/typo3cms extension:setupactive
vendor/bin/typo3cms database:updateschema
vendor/bin/typo3cms cache:flush
crons:
typo3:
spec: "*/5 * * * *"
cmd: "vendor/bin/typo3cms scheduler:run"