Skip to content

Instantly share code, notes, and snippets.

@wesleyalmd
Created November 17, 2022 21:38
Show Gist options
  • Save wesleyalmd/85639105eb41492e9fd82c6a22f01f03 to your computer and use it in GitHub Desktop.
Save wesleyalmd/85639105eb41492e9fd82c6a22f01f03 to your computer and use it in GitHub Desktop.
# 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: PROJECT_NAME
# The toolstack used to build the application.
type: php:7.4
build:
flavor: composer
# Enable extensions required by Magento 2
runtime:
extensions:
- xsl
- json
- newrelic
- sodium
- ioncube
# 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 environment variable. The right-hand
# side is in the form `<service name>:<endpoint name>`.
relationships:
database: "mysql:mysql"
redis: "redis:redis"
elasticsearch: "elasticsearch:elasticsearch"
rabbitmq: "rabbitmq:rabbitmq"
# The configuration of app when it is exposed to the web.
web:
locations:
"/":
# The public directory of the app, relative to its root.
root: "pub"
# The front-controller script to send non-static requests to.
passthru: "/index.php"
index:
- index.php
expires: -1
scripts: true
allow: false
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
expires: 1y
passthru: "/get.php"
"/static":
root: "pub/static"
allow: true
scripts: false
expires: 1y
passthru: "/front-static.php"
rules:
^/static/version\d+/(?<resource>.*)$:
passthru: "/static/$resource"
# 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:
"var": "shared:files/var"
"app/etc": "shared:files/etc"
"pub/media": "shared:files/media"
"pub/static": "shared:files/static"
hooks:
# We run build hooks before your application has been packaged.
build: |
set -e
pip install setuptools --upgrade --user
pip install colorama --upgrade --user
pip install awscli --upgrade --user
unset NPM_CONFIG_PREFIX
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install --lts=dubnium
npm install -g [email protected] [email protected] [email protected] [email protected]
(cd pwa && NODE_ENV=development yarn install --ignore-optional && STORE_VIEW_CODE=storeview_code yarn buildpack create-env-file . && yarn build)
php ./vendor/bin/ece-tools run scenario/build/generate.xml
php ./vendor/bin/ece-tools run scenario/build/transfer.xml
# We run deploy hook after your application has been deployed and started.
deploy: |
php ./vendor/bin/ece-tools run scenario/deploy.xml
# We run post deploy hook to clean and warm the cache. Available with ECE-Tools 2002.0.10.
post_deploy: |
php ./vendor/bin/ece-tools run scenario/post-deploy.xml
# Default Magento 2 cron jobs
crons:
cronrun:
spec: "* * * * *"
cmd: "php bin/magento cron:run"
# Environment variables
variables:
env:
NVM_VERSION: v0.39.1
NODE_VERSION: v14.13.1
CONFIG__DEFAULT__PAYPAL_ONBOARDING__MIDDLEMAN_DOMAIN: 'payment-broker.magento.com'
CONFIG__STORES__DEFAULT__PAYPAL__NOTATION_CODE: 'Magento_Enterprise_Cloud'
CONFIG__DEFAULT__WEB__UPWARD__PATH: /app/pwa/dist/upward.yml
CHECKOUT_BRAINTREE_TOKEN: ''
NODE_ENV: production
MAGENTO_BACKEND_URL: 'https://domain_name/'
GTM_KEY: ''
ADMIN_URL: ''
MAGENTO_BACKEND_EDITION: EE
IMAGE_OPTIMIZING_ORIGIN: backend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment