dudi/docs/deployment.md
Simon Kühn fd473f00af Initial commit: Dudi habit tracker
Symfony 8 SPA with Doctrine ORM, Symfony Security, vanilla JS frontend.
Migrated from plain PHP (delight-im/auth + raw SQL) to full Symfony stack.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 15:40:57 +02:00

1.8 KiB

Deployment

Server: miniweb.kuehn.home

  • SSH: ssh -p 30183 root@miniweb.kuehn.home
  • App dir: /var/www/tracker/
  • Apache DocumentRoot: /var/www/tracker/public/
  • Database: MariaDB, DB name dd, user dd
  • URL: http://miniweb.kuehn.home/dd/

First-time Setup (already done)

cd /var/www/tracker
composer install --no-dev --optimize-autoloader
# create .env.local with real credentials (see below)
php bin/console cache:clear --env=prod

.env.local on server

APP_ENV=prod
APP_SECRET=<random 32 hex chars>
DATABASE_URL="mysql://dd:<password>@127.0.0.1:3306/dd?serverVersion=mariadb-8.3.0&charset=utf8mb4"
APP_URL=http://miniweb.kuehn.home/dd
DEFAULT_URI=http://miniweb.kuehn.home/dd
MAILER_DSN=smtp://user:pass@smtp.example.com:587
MAILER_FROM=noreply@example.com

Apache VirtualHost (or adjust existing)

<VirtualHost *:80>
    ServerName miniweb.kuehn.home
    DocumentRoot /var/www/tracker/public
    <Directory /var/www/tracker/public>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Database remember-me table

CREATE TABLE IF NOT EXISTS rememberme_token (
    series VARCHAR(88) NOT NULL,
    value VARCHAR(88) NOT NULL,
    lastUsed DATETIME NOT NULL,
    class VARCHAR(100) DEFAULT '' NOT NULL,
    username VARCHAR(200) NOT NULL,
    PRIMARY KEY (series)
) DEFAULT CHARACTER SET utf8mb4;

Deploying Updates

bash deploy.sh

This rsync's the project (excluding vendor/, var/, .env.local), runs composer install --no-dev and cache:clear --env=prod remotely.

Local Development

  • URL: http://dudi.local/
  • Apache VirtualHost with DocumentRoot /srv/http/zieltracker/public
  • /etc/hosts: 127.0.0.1 dudi.local
  • DB: MariaDB, db zieltracker, user zieltracker
  • APP_ENV=dev (Symfony debug bar active)