-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.platform.app.yaml
152 lines (133 loc) · 5.9 KB
/
.platform.app.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# This file describes an application. You can have multiple applications
# in the same project.
# Please see doc/platformsh/README.md and doc/platformsh/INSTALL.md
# NB: Clustered eZ Platform setups are not tested and are likely to have issues.
# The name of this app. Must be unique within a project.
name: app
dependencies:
nodejs:
yarn: "*"
# The type of the application to build.
type: php:7.3
build:
# "none" means we're running composer manually, see build hook
flavor: "none"
# 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 `<service name>:<endpoint name>`.
relationships:
database: 'mysqldb:user'
# Uncomment if you want to store dfs tables in a separate database:
#dfs_database: 'mysqldb:dfs'
rediscache: 'rediscache:redis'
# If you wish to have a separate Redis instance for sessions, uncomment
# this relationship and the corresponding service in .platform/services.yaml
#redissession: 'redissession:redis'
# If you wish to use solr, uncomment this relationship and the corresponding service in .platform/services.yaml
#solr: 'solrsearch:collection1'
variables:
#php:
# Example of setting php.ini config
#"display_errors": "On"
env:
# We disable Symfony Proxy, as we rather use Varnish
SYMFONY_HTTP_CACHE: 0
SYMFONY_TRUSTED_PROXIES: "TRUST_REMOTE"
# Change this if you use a different env then "prod", if you change this to "dev" remove "--no-dev" in build step
SYMFONY_ENV: prod
# Uncomment if you want to use DFS clustering:
#PLATFORMSH_DFS_NFS_PATH: 'dfsdata'
# The configuration of app when it is exposed to the web.
web:
locations:
"/":
# The public directory of the app, relative to its root.
root: "web"
# The front-controller script to send non-static requests to.
passthru: "/app.php"
# The number of seconds whitelisted (static) content should be cache
expires: 600
# The size of the persistent disk of the application (in MB).
disk: 3072
# The mounts that will be performed when the package is deployed.
mounts:
'var/cache':
source: local
source_path: cache
'var/logs':
source: local
source_path: logs
'var/encore':
source: local
source_path: encore
'web/var':
source: local
source_path: var
# To be prepared to move to cluster, please rather use e.g. persisted Redis instance.
'web/sessions':
source: local
source_path: sessions
# Uncomment if you need to use Kaliop Migrations on your setup and not able to get it to write to "var" dir.
# 'src/AppBundle/MigrationVersions/References':
# source: local
# source_path: MigrationVersionsReferences
# Uncomment if you want to use DFS clustering, WARNING: Needs to be shared, contact Platform.sh support to set this up
# 'dfsdata':
# source: shared
# source_path: dfsdata
# The hooks that will be performed when the package is deployed.
hooks:
# Build hook, done before connected to services, disk is still writable here
build: |
set -e
# Configure GITHUB token if set. For use if you have own private repos, or to avoid API rate limits.
if [ -n "$GITHUB_TOKEN" ]; then
composer config github-oauth.github.com $GITHUB_TOKEN
fi
rm web/app_dev.php
composer install --no-dev --prefer-dist --no-progress --no-interaction --optimize-autoloader
# Deploy hook, access to services & done once (per cluster, not per node), only mounts are writable at this point
# Note: Http traffic is paused while this is running, so for prod code this should finish as fast as possible, < 30s
deploy: |
set -e
# Mainly relevant for eZ Platform demo usage, for own setup adapt this or remove and rely on migrations.
if [ ! -f web/var/.platform.installed ]; then
# To workaround issues with p.sh Varnish we clear container cache & temporary set Symfony Proxy
rm -Rf var/cache/$SYMFONY_ENV/*.*
HTTPCACHE_PURGE_TYPE="local" php -d memory_limit=-1 `which composer` ezplatform-install
touch web/var/.platform.installed
fi
# Now that mounts are available, clear class/container cache. E.g. in case of interface changes on lazy proxies
rm -Rf var/cache/$SYMFONY_ENV/*.*
# With that done, make sure to clear + warmup all remaining caches to take proper env variables into account
bin/console cache:clear
# Example of additional deploy hooks if you use doctrine and/or kaliop migration bundle
##bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration
##bin/console kaliop:migration:migrate --no-interaction --no-debug
# Post deploy hook, like deploy but after being deployed and live, for deploy tasks we can do asynchronously
#post_deploy: |
# set -e
# The configuration of scheduled execution.
# see https://docs.platform.sh/configuration/app/cron.html#cron-jobs
crons:
frequent:
# NOTE: The minimum interval between cron runs is 5 minutes, even if specified as less.
# Except for PE. There crons can be run every minute.
# So if you are not on PE please change specs to "*/5 * * * *" to avoid warning on each deploy.
spec: "* * * * *"
cmd: "php bin/console ezplatform:cron:run"
weekly:
spec: "0 0 * * 0"
cmd: "php bin/console ezplatform:check-urls --quiet"
runtime:
extensions:
- xsl
- imagick
- readline
- redis
#- apcu
#- name: 'blackfire'
# configuration:
# server_id: 'xxxx-xxx-xxx-xxx-xxxx'
# server_token: 'xxxx'