Getting Started

Symfony Application in Production

Some brief considerations regarding the deployment of the application on a production server.

.env file

The .env file in development mode:

PHP_IDE_CONFIG="serverName=localhost"
NGINX_PORT=82
DOCUMENTATION_PROJECTS='{
"automarkdoc": {
"path": "documentations/AutoMarkDoc",
"segment": "automarkdoc",
"host": "localhost",
"name": "AutoMarkDoc"
}
}'
APP_ENV=dev
APP_DEBUG=1

The .env file in production mode:

PHP_IDE_CONFIG="serverName=localhost"
NGINX_PORT=82
DOCUMENTATION_PROJECTS='{
"automarkdoc": {
    "path": "documentations/AutoMarkDoc",
    "segment": "",
    "host": "doc.my-domain.com",
    "name": "AutoMarkDoc"
    }
}'
APP_ENV=prod
APP_DEBUG=0

Composer commands & Asset-map compile

If for development you need to run the composer install command, for production deployment you will need a series of commands like:

composer install --no-dev --optimize-autoloader
php bin/console cache:warmup --env=prod
php bin/console asset-map:compile