-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
15-symfony-flex-platformsh.yaml
84 lines (70 loc) · 2.35 KB
/
15-symfony-flex-platformsh.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
requirements:
- type: file_exists
value: composer.json
- type: has_composer_package
value: symfony/flex
- type: has_composer_package
value: symfonycorp/platformsh-meta
template: |
name: {{.Slug}}
type: php:{{.PhpVersion}}
dependencies:
php:
composer/composer: "^2"
runtime:
extensions:
{{ range $ext := $.PHPExtensions -}}
{{- if php_extension_available $ext $.PhpVersion -}}
- {{ $ext }}
{{ end -}}
{{- end }}
{{ if php_at_least "7.4" -}}
variables:
php:
opcache.preload: config/preload.php
{{- end }}
build:
flavor: none
disk: 1024
web:
locations:
"/":
root: "{{.PublicDirectory}}"
expires: 1h
passthru: "/{{.FrontController}}"
mounts:
"/var": { source: local, source_path: var }
{{ if file_exists "templates/debug/source_code.html.twig" -}}
"/data": { source: local, source_path: "data" }
{{- end }}
{{ if $.Services -}}
relationships:
{{ range $service := $.Services -}}
{{ $service.Name }}: "{{ $service.Name }}:{{ $service.Type }}"
{{ end -}}
{{- end }}
hooks:
build: |
set -x -e
curl -fs https://get.symfony.com/cloud/configurator | bash
{{ range $ext := $.PHPExtensions -}}
{{- if not (php_extension_available $ext $.PhpVersion) -}}
# php-ext-install {{ $ext }} X.Y.Z
{{ end -}}
{{- end }}
NODE_VERSION=22 symfony-build
deploy: |
set -x -e
symfony-deploy
crons:
security-check:
# Check that no security issues have been found for PHP packages deployed in production
spec: '50 23 * * *'
cmd: if [ "$PLATFORM_ENVIRONMENT_TYPE" = "production" ]; then croncape COMPOSER_ROOT_VERSION=1.0.0 COMPOSER_AUDIT_ABANDONED=ignore composer audit --no-cache; fi
{{ if has_composer_package "symfony/messenger" -}}
workers:
messenger:
commands:
# Consume "async" messages (as configured in the routing section of config/packages/messenger.yaml)
start: symfony console --time-limit=3600 --memory-limit=64M messenger:consume async
{{- end }}