A Symfony project created on July 28, 2016, 1:44 pm.
Персональный веб-сайт Михаила Драгункина.
dotudash is built on top of:
- php 8.4 / symfony 7
- node.js11 / npm6 / bower / gulp / webpack
Static files managed by:
- imagemagick
- optipng
- wkhtmltopdf
There are two methods of running an application: docker way and classic (native).
There are two environments to deploy an application with docker: production, development.
Run application in production environment:
docker compose -f compose.yaml -f compose.prod.yaml up -dNote
After containers built in production environment,
any files modification in local directories
are not reflected into any container, as files there are isolated.
For consistent changes use development environment.
Run application in development environment:
docker compose -f compose.yaml -f compose.dev.yaml up -dFrontend development requires few dependencies to be installed once.
Install global requirements:
npm install -g bower gulp npm-run-all webpackInstall frontend application requirements:
npm install
bower installInstall backend application requirements:
composer installBuild frontend assets:
npm run buildTo rebuild frontend each time on project files change:
npm run devOptionally: backend application cache warmup:
./bin/console cache:warmupFor static data processing is better to proxy traffic via nginx, with configuration for example:
Nginx configuration example
server {
listen 80;
server_name "dotudash" "*.dotudash";
root ".../dotudash/web";
if ($host = 'static.dotudash') {
rewrite ^/(?!bundles|static|\.well-known) http://dotudash/ permanent;
}
location / {
try_files $uri /app_dev.php$is_args$args; // (!) note the environment specific application entrypoint
}
location ~ ^/app_dev\.php(/|$) {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://127.0.0.1:8000; // php-fpm
internal;
}
location ~ /\. {
# deny all;
}
}
When the project is first run, initialization is necessary:
- Initialize database:
./bin/console doctrine:database:create ./bin/console doctrine:schema:create # fill database with test content: # ./bin/console doctrine:fixtures:load --no-interaction # ./bin/console doctrine:migration:migrate --no-interaction
- Dump vendor assets into public shared directory (required for admin section of web-site):
./bin/console assets:install
wkhtmltopdf \
-s A4 -O Portrait --zoom 0.95 \
http://dotudash/résumé/d8901cd7-d347-46bc-8c72-3147fc5a59e7 \
./web/media/main/résumé/résumé.pdfNote
This method requires application to be launched