-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.platform.app.yaml
161 lines (146 loc) · 7.42 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
153
154
155
156
157
158
159
160
161
# Complete list of all available properties: https://docs.platform.sh/create-apps/app-reference.html
# A unique name for the app. Must be lowercase alphanumeric characters. Changing the name destroys data associated
# with the app.
name: magento
# The runtime the application uses.
# Complete list of available runtimes: https://docs.platform.sh/create-apps/app-reference.html#types
type: php:7.4
# 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>`.
# More information: https://docs.platform.sh/create-apps/app-reference.html#relationships
relationships:
database: magento_database:mysql
redis: magento_redis:redis
search: magento_search:opensearch
# The size of the persistent disk of the application (in MB). Minimum value is 128.
disk: 2048
# Mounts define directories that are writable after the build is complete. If set as a local source, disk property is required.
# More information: https://docs.platform.sh/create-apps/app-reference.html#mounts
mounts:
"var": "shared:files/var"
"generated": "shared:files/generated"
"app/etc": "shared:files/etc"
"pub/media": "shared:files/media"
"pub/static": "shared:files/static"
# The web key configures the web server running in front of your app.
# More information: https://docs.platform.sh/create-apps/app-reference.html#web
web:
# Each key in locations is a path on your site with a leading /.
# More information: https://docs.platform.sh/create-apps/app-reference.html#locations
locations:
'/':
# The directory to serve static assets for this location relative to the app’s root directory. Must be an
# actual directory inside the root directory.
root: "pub"
# Whether to forward disallowed and missing resources from this location to the app. A string is a path
# with a leading / to the controller, such as /index.php.
passthru: "/index.php"
# Files to consider when serving a request for a directory.
index:
- index.php
# Whether to allow scripts to run. Doesn’t apply to paths specified in passthru. Meaningful only on PHP containers.
scripts: true
# Whether to allow serving files which don’t match a rule.
allow: false
# The key of each item in rules is a regular expression to match paths exactly. If an incoming request
# matches the rule, it’s handled by the properties under the rule, overriding any conflicting rules from the
# rest of the locations properties.
# More information: https://docs.platform.sh/create-apps/app-reference.html#rules
rules:
\.(css|js|map|hbs|gif|jpe?g|png|tiff|wbmp|ico|jng|bmp|svgz|midi?|mp?ga|mp2|mp3|m4a|ra|weba|3gpp?|mp4|mpe?g|mpe|ogv|mov|webm|flv|mng|asx|asf|wmv|avi|ogx|swf|jar|ttf|eot|woff|otf|html?)$:
allow: true
^/sitemap(.*)\.xml$:
passthru: "/media/sitemap$1.xml"
'/media':
root: "pub/media"
allow: true
scripts: false
passthru: "/get.php"
expires: 1y
'/static':
root: "pub/static"
allow: true
scripts: false
passthru: "/static.php"
expires: 1y
rules:
^/static/version\d+/(?<resource>.*)$:
passthru: "/static/$resource"
# Alternate copies of the application to run as background processes.
# More information: https://docs.platform.sh/create-apps/app-reference.html#workers
workers:
queue:
size: S
disk: 128
commands:
start: |
bin/magento queue:consumers:start async.operations.all --single-thread --max-messages=10000
# Variables to control the environment. More information: https://docs.platform.sh/create-apps/app-reference.html#variables
variables:
# Customize your PHP.ini.
# See: https://docs.platform.sh/languages/php/ini.html
php:
# Include Magento's out-of-the-box settings
include: /app/.user.ini
# Specifies a default set of build tasks to run. Flavors are language-specific.
# More information: https://docs.platform.sh/create-apps/app-reference.html#build
build:
flavor: composer
# Installs global dependencies as part of the build process. They’re independent of your app’s dependencies and
# are available in the PATH during the build process and in the runtime environment. They’re installed before
# the build hook runs using a package manager for the language.
# More information: https://docs.platform.sh/create-apps/app-reference.html#dependencies
dependencies:
php:
composer/composer: "2.2.22"
# Hooks allow you to customize your code/environment as the project moves through the build and deploy stages
# More information: https://docs.platform.sh/create-apps/app-reference.html#hooks
hooks:
# The build hook is run after any build flavor.
# More information: https://docs.platform.sh/create-apps/hooks/hooks-comparison.html#build-hook
build: |
set -e
mkdir -p .versioned_backup/etc && cp app/etc/* .versioned_backup/etc/
# The deploy hook is run after the app container has been started, but before it has started accepting requests.
# More information: https://docs.platform.sh/create-apps/hooks/hooks-comparison.html#deploy-hook
deploy: |
set -e
cp .versioned_backup/etc/* app/etc/
php deploy.php
# Scheduled tasks for the app.
# More information: https://docs.platform.sh/create-apps/app-reference.html#crons
crons:
magento:
spec: "*/5 * * * *"
commands:
start: "php bin/magento cron:run"
###
# Customizations to your PHP or Lisp runtime. More information: https://docs.platform.sh/create-apps/app-reference.html#runtime
# Specify additional PHP extensions that should be loaded.
# To determine what you need to enable
# 1. run locally: composer check-platform-reqs | grep "ext-\|php"
# 2. Compare to https://docs.platform.sh/languages/php/extensions.html
# - "Def" = Already Enabled
# - "Avail" = Available, but you need to enable below.
runtime:
extensions:
- xsl
- sodium
# Information on the app's source code and operations that can be run on it.
# More information: https://docs.platform.sh/create-apps/app-reference.html#source
source:
######################################################################################################################
## ##
## This source operation is part of the Platform.sh process of updating and maintaining our collection of ##
## templates. For more information see https://docs.platform.sh/create-apps/source-operations.html and ##
## https://github.com/platformsh/source-operations ##
## ##
## YOU CAN SAFELY DELETE THIS COMMENT AND THE LINES BENEATH IT ##
## ##
######################################################################################################################
operations:
auto-update:
command: |
curl -fsS https://raw.githubusercontent.com/platformsh/source-operations/main/setup.sh | { bash /dev/fd/3 sop-autoupdate; } 3<&0