Add Upsun config

This commit is contained in:
Nicolas Grekas
2025-11-20 17:49:33 +01:00
parent f78ac3574e
commit f9733249e8
3 changed files with 62 additions and 1 deletions

54
.upsun/config.yaml Normal file
View File

@@ -0,0 +1,54 @@
routes:
"https://{all}/": { type: upstream, upstream: "app:http" }
"http://{all}/": { type: redirect, to: "https://{all}/" }
services:
applications:
app:
source:
root: "/ai.symfony.com"
type: php:8.4
runtime:
extensions:
variables:
php:
opcache.preload: config/preload.php
build:
flavor: none
web:
locations:
"/":
root: "public/"
expires: 1h
passthru: "/index.php"
mounts:
"/var/cache": { source: instance, source_path: var/cache }
"/var/share": { source: storage, source_path: var/share }
hooks:
build: |
set -x -e
curl -fs https://get.symfony.com/cloud/configurator | bash
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
clean-expired-sessions:
spec: '17,47 * * * *'
cmd: croncape php-session-clean

View File

@@ -27,7 +27,6 @@
"symfony/flex": true,
"symfony/runtime": true
},
"bump-after-update": true,
"sort-packages": true
},
"autoload": {

8
ai.symfony.com/php.ini Normal file
View File

@@ -0,0 +1,8 @@
allow_url_include=off
display_errors=off
display_startup_errors=off
max_execution_time=30
session.gc_probability=0
session.use_strict_mode=On
realpath_cache_ttl=3600
zend.detect_unicode=Off