survos / deployment-bundle
Tools for deploying Survos projects to dokku
Package info
github.com/survos/deployment-bundle
Type:symfony-bundle
pkg:composer/survos/deployment-bundle
Fund package maintenance!
Requires
- php: ^8.5
- survos/kit-bundle: ^2.5
- symfony/config: ^8.1
- symfony/console: ^8.1
- symfony/dependency-injection: ^8.1
- symfony/form: ^8.1
- symfony/http-kernel: ^8.1
- symfony/process: ^8.1
- twig/twig: ^3.4|^4.0
Requires (Dev)
- phpstan/phpstan: ^2.0
- symfony/browser-kit: ^8.1
- symfony/framework-bundle: ^8.1
- symfony/phpunit-bridge: ^8.1
- symfony/twig-bundle: ^8.1
- symfony/var-dumper: ^8.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 2.26.11
- 2.26.9
- 2.24.35
- 2.24.30
- 2.24.22
- 2.24.17
- 2.24.8
- 2.18.18
- 2.18.0
- 2.15.8
- 2.12.11
- 2.10.19
- 2.10.18
- 2.10.17
- 2.10.16
- 2.10.15
- 2.10.14
- 2.10.13
- 2.10.12
- 2.10.11
- 2.10.10
- 2.10.9
- 2.10.8
- 2.10.7
- 2.10.6
- 2.10.5
- 2.10.4
- 2.10.3
- 2.10.2
- 2.10.1
- 2.10.0
- 2.9.4
- 2.9.3
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.4
- 2.8.3
- 2.8.2
- 2.8.1
- 2.8.0
- 2.7.23
- 2.7.22
- 2.7.21
- 2.7.20
- 2.7.19
- 2.7.18
- 2.7.17
- 2.7.16
- 2.7.15
- 2.7.14
- 2.7.13
- 2.7.12
- 2.7.11
- 2.7.10
- 2.7.9
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.4
- 2.7.3
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.0
- 2.5.8
- 2.5.7
- 2.5.6
- 2.5.5
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.0
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.2
- 2.1.1
- 2.0.220
- 2.0.219
- 2.0.218
- 2.0.217
- 2.0.216
- 2.0.215
- 2.0.214
- 2.0.213
- 2.0.212
- 2.0.211
- 2.0.210
- 2.0.209
- 2.0.208
- 2.0.207
- 2.0.206
- 2.0.205
- 2.0.204
- 2.0.203
- 2.0.202
- 2.0.201
- 2.0.200
- 2.0.199
- 2.0.198
- 2.0.197
- 2.0.196
- 2.0.195
- 2.0.194
- 2.0.193
- 2.0.192
- 2.0.191
- 2.0.190
- 2.0.189
- 2.0.188
- 2.0.187
- 2.0.186
- 2.0.185
- 2.0.184
- 2.0.183
- 2.0.182
- 2.0.181
- 2.0.180
- 2.0.179
- 2.0.178
- 2.0.177
- 2.0.176
- 2.0.175
- 2.0.174
- 2.0.173
- 2.0.172
- 2.0.171
- 2.0.170
- 2.0.169
- 2.0.168
- 2.0.167
- 2.0.166
- 2.0.165
- 2.0.164
- 2.0.163
- 2.0.162
- 2.0.161
- 2.0.160
- 2.0.159
- 2.0.158
- 2.0.156
- 2.0.155
- 2.0.154
- 2.0.146
- 2.0.145
- 2.0.144
- 2.0.143
- 2.0.142
- 2.0.141
- 2.0.140
- 2.0.139
- 2.0.138
- 2.0.137
- 2.0.136
- 2.0.135
- 2.0.134
- 2.0.133
- 2.0.132
- 2.0.131
- 2.0.130
- 2.0.129
- 2.0.128
- 2.0.127
- 2.0.126
- 2.0.125
- 2.0.124
- 2.0.123
- 2.0.122
- 2.0.121
- 2.0.120
- 2.0.119
- 2.0.117
- 2.0.116
- 2.0.115
- 2.0.114
- 2.0.113
- 2.0.112
- 2.0.111
- 2.0.110
- 2.0.109
- 2.0.108
- 2.0.107
- 2.0.106
- 2.0.105
- 2.0.104
- 2.0.103
- 2.0.102
- 2.0.101
- 2.0.100
- 2.0.99
- 2.0.98
- 2.0.97
- 2.0.96
- 2.0.95
- 2.0.94
- 2.0.93
- 2.0.92
- 2.0.91
- 2.0.90
- 2.0.89
- 2.0.88
- 2.0.87
- 2.0.86
- 2.0.85
- 2.0.84
- 2.0.83
- 2.0.82
- 2.0.81
- 2.0.80
- 2.0.79
- 2.0.78
- 2.0.77
- 2.0.76
- 2.0.75
- 2.0.74
- 2.0.73
- 2.0.72
- 2.0.71
- 2.0.70
- 2.0.69
- 2.0.68
- 2.0.67
- 2.0.66
- 2.0.65
- 2.0.64
- 2.0.63
- 2.0.62
- 2.0.61
- 2.0.60
- 2.0.59
- 2.0.58
- 2.0.57
- 2.0.56
- 2.0.55
- 2.0.54
- 2.0.53
- 2.0.51
- 2.0.50
- 2.0.49
- 2.0.48
- 2.0.47
- 2.0.46
- 2.0.45
- 2.0.44
- 2.0.43
- 2.0.42
- 2.0.41
- 2.0.40
- 2.0.39
- 2.0.38
- 2.0.37
- 2.0.36
- 2.0.35
- 2.0.34
- 2.0.33
- 2.0.32
- 2.0.31
- 2.0.30
- 2.0.29
- 2.0.28
- 2.0.27
- 2.0.26
- 2.0.25
- 2.0.24
- 2.0.23
- 2.0.22
- 2.0.21
- 2.0.20
- 2.0.19
- 2.0.18
- 2.0.17
- 2.0.16
- 2.0.15
- 2.0.14
- 2.0.13
- 2.0.12
- 1.6.44
- 1.6.43
- 1.6.42
- 1.6.41
- 1.6.40
- 1.6.39
- 1.6.38
- 1.6.37
- 1.6.36
- 1.6.35
- 1.6.34
- 1.6.33
- 1.6.32
- 1.6.31
- 1.6.30
- 1.6.29
- 1.6.28
- 1.6.27
- 1.6.26
- 1.6.25
- 1.6.24
- 1.6.23
- 1.6.22
- 1.6.21
- 1.6.20
- 1.6.19
- 1.6.18
- 1.6.17
- 1.6.16
- 1.6.15
- 1.6.14
- 1.6.13
- 1.6.12
- 1.6.11
- 1.6.10
- 1.6.9
- 1.6.8
- 1.6.7
- 1.6.6
- 1.6.5
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.529
- 1.5.528
- 1.5.527
- 1.5.526
- 1.5.525
- 1.5.524
- 1.5.523
- 1.5.522
- 1.5.521
- 1.5.520
- 1.5.519
- 1.5.518
- 1.5.517
- 1.5.516
- 1.5.515
- 1.5.514
- 1.5.513
- 1.5.512
- 1.5.511
- 1.5.510
- 1.5.509
- 1.5.508
- 1.5.507
- 1.5.506
- 1.5.505
- 1.5.504
- 1.5.503
- 1.5.502
- 1.5.501
- 1.5.500
- 1.5.499
- 1.5.498
- 1.5.497
- 1.5.496
- 1.5.495
- 1.5.494
- 1.5.493
- 1.5.492
- 1.5.491
- 1.5.490
- 1.5.489
- 1.5.488
- 1.5.487
- 1.5.486
- 1.5.485
- 1.5.484
- 1.5.483
- 1.5.482
- 1.5.481
- 1.5.480
- 1.5.479
- 1.5.478
- 1.5.477
- 1.5.476
- 1.5.475
- 1.5.474
- 1.5.473
- 1.5.472
- 1.5.471
- 1.5.470
- 1.5.469
- 1.5.468
- 1.5.467
- 1.5.466
- 1.5.465
- 1.5.464
- 1.5.463
- 1.5.462
- 1.5.461
- 1.5.460
- 1.5.459
- 1.5.458
- 1.5.457
- 1.5.456
- 1.5.455
- 1.5.454
- 1.5.453
- 1.5.452
- 1.5.451
- 1.5.450
- 1.5.449
- 1.5.448
- 1.5.447
- 1.5.446
- 1.5.445
- 1.5.444
- 1.5.443
- 1.5.442
- 1.5.441
- 1.5.440
- 1.5.439
- 1.5.438
- 1.5.437
- 1.5.436
- 1.5.435
- 1.5.434
- 1.5.433
- 1.5.432
- 1.5.431
- 1.5.430
- 1.5.429
- 1.5.428
- 1.5.427
- 1.5.426
- 1.5.425
- 1.5.424
- 1.5.423
- 1.5.422
- 1.5.421
- 1.5.420
- 1.5.419
- 1.5.418
- 1.5.417
- 1.5.416
- 1.5.415
- 1.5.414
- 1.5.413
- 1.5.412
- 1.5.411
- 1.5.410
- 1.5.409
- 1.5.408
- 1.5.407
- 1.5.406
- 1.5.405
- 1.5.404
- 1.5.403
- 1.5.402
- 1.5.401
- 1.5.400
- 1.5.399
- 1.5.398
- 1.5.397
- 1.5.396
- 1.5.395
- 1.5.394
- 1.5.393
- 1.5.392
- 1.5.391
- 1.5.390
- 1.5.389
- 1.5.388
- 1.5.387
- 1.5.386
- 1.5.385
- 1.5.384
- 1.5.383
- 1.5.382
- 1.5.381
- 1.5.380
- 1.5.379
- 1.5.378
- 1.5.377
- 1.5.376
- 1.5.375
- 1.5.374
- 1.5.373
- 1.5.372
- 1.5.371
- 1.5.370
- 1.5.369
- 1.5.368
- 1.5.367
- 1.5.366
- 1.5.365
- 1.5.364
- 1.5.363
- 1.5.362
- 1.5.361
- 1.5.360
- 1.5.359
- 1.5.358
- 1.5.357
- 1.5.356
- 1.5.355
- 1.5.354
- 1.5.353
- 1.5.352
- 1.5.351
- 1.5.350
- 1.5.349
- 1.5.345
- 1.5.344
- 1.5.343
- 1.5.342
- 1.5.341
- 1.5.340
- 1.5.339
- 1.5.338
- 1.5.337
- 1.5.336
- 1.5.335
- 1.5.334
- 1.5.333
- 1.5.332
- 1.5.331
- 1.5.330
- 1.5.329
- 1.5.328
- 1.5.327
- 1.5.326
- 1.5.325
- 1.5.324
- 1.5.323
- 1.5.322
- 1.5.321
- 1.5.320
- 1.5.319
- 1.5.318
- 1.5.317
- 1.5.316
- 1.5.315
- 1.5.314
- 1.5.313
- 1.5.312
- 1.5.311
- 1.5.310
- 1.5.309
- 1.5.308
- 1.5.307
- 1.5.306
- 1.5.305
- 1.5.304
- 1.5.303
- 1.5.302
- 1.5.301
- 1.5.300
- 1.5.299
- 1.5.298
- 1.5.297
- 1.5.296
- 1.5.295
- 1.5.294
- 1.5.293
- 1.5.292
- 1.5.291
- 1.5.290
- 1.5.289
- 1.5.288
- 1.5.287
- 1.5.286
- 1.5.285
- 1.5.284
- 1.5.283
- 1.5.282
- 1.5.281
- 1.5.280
- 1.5.279
- 1.5.278
- 1.5.277
- 1.5.276
- 1.5.275
- 1.5.274
- 1.5.273
- 1.5.272
- 1.5.271
- 1.5.270
- 1.5.269
- 1.5.268
- 1.5.267
- 1.5.266
- 1.5.265
- 1.5.264
- 1.5.263
- 1.5.262
- 1.5.261
- 1.5.260
- 1.5.259
- 1.5.258
- 1.5.257
- 1.5.256
- 1.5.255
- 1.5.254
- 1.5.253
- 1.5.252
- 1.5.251
- 1.5.250
- 1.5.249
- 1.5.248
- 1.5.247
- 1.5.246
- 1.5.245
- 1.5.244
- 1.5.243
- 1.5.242
- 1.5.241
- 1.5.240
- 1.5.239
- 1.5.238
- 1.5.237
- 1.5.236
- 1.5.235
- 1.5.234
- 1.5.233
- 1.5.232
- 1.5.231
- 1.5.230
- 1.5.229
- 1.5.228
- 1.5.227
- 1.5.226
- 1.5.225
- 1.5.224
- 1.5.223
- 1.5.222
- 1.5.221
- 1.5.220
- 1.5.219
- 1.5.218
- 1.5.217
- 1.5.216
- 1.5.215
- 1.5.214
- 1.5.213
- 1.5.212
- 1.5.211
- 1.5.210
- 1.5.209
- 1.5.208
- 1.5.207
- 1.5.206
- 1.5.205
- 1.5.204
- 1.5.203
- 1.5.202
- 1.5.201
- 1.5.200
- 1.5.199
- 1.5.198
- 1.5.197
- 1.5.196
- 1.5.195
- 1.5.194
- 1.5.193
- 1.5.192
- 1.5.191
- 1.5.190
- 1.5.189
- 1.5.188
- 1.5.187
- 1.5.186
- 1.5.185
- 1.5.184
- 1.5.183
- 1.5.182
- 1.5.181
- 1.5.180
- 1.5.179
- 1.5.178
- 1.5.177
- 1.5.176
- 1.5.175
- 1.5.174
- 1.5.173
- 1.5.172
- 1.5.171
- 1.5.170
- 1.5.169
- 1.5.168
- 1.5.167
- 1.5.166
- 1.5.165
- 1.5.164
- 1.5.163
- 1.5.162
- 1.5.161
- 1.5.160
- 1.5.159
- 1.5.158
- 1.5.157
- 1.5.156
- 1.5.155
- 1.5.154
- 1.5.153
- 1.5.152
- 1.5.151
- 1.5.150
- 1.5.149
- 1.5.148
- 1.5.147
- 1.5.146
- 1.5.145
- 1.5.144
- 1.5.143
- 1.5.142
- 1.5.141
- 1.5.140
- 1.5.139
- 1.5.138
- 1.5.137
- 1.5.136
- 1.5.135
- 1.5.134
- 1.5.133
- 1.5.132
- 1.5.131
- 1.5.130
- 1.5.129
- 1.5.128
- 1.5.127
- 1.5.126
- 1.5.125
- 1.5.124
- 1.5.123
- 1.5.122
- 1.5.121
- 1.5.120
- 1.5.119
- 1.5.118
- 1.5.117
- 1.5.116
- 1.5.115
- 1.5.114
- 1.5.113
- 1.5.112
- 1.5.111
- 1.5.110
- 1.5.109
- 1.5.108
- 1.5.107
- 1.5.106
- 1.5.105
- 1.5.104
- 1.5.103
- 1.5.102
- 1.5.101
- 1.5.100
- 1.5.99
- 1.5.98
- 1.5.97
- 1.5.96
- 1.5.95
- 1.5.94
- 1.5.93
- 1.5.92
- 1.5.91
- 1.5.90
- 1.5.89
- 1.5.88
- 1.5.87
- 1.5.86
- 1.5.85
- 1.5.84
- 1.5.83
- 1.5.82
- 1.5.81
- 1.5.80
- 1.5.79
- 1.5.78
This package is auto-updated.
Last update: 2026-08-31 23:51:12 UTC
README
Helpers for deploying a Symfony app to Dokku (e.g. on Hetzner). Provides a
single dokku console command that creates the app, scaffolds the deployment
files (Procfile, nginx.conf, fpm_custom.conf, app.json), manages config
and storage, and deploys.
composer require --dev survos/deployment-bundle
The dokku command
bin/console dokku <action> [param] [--app=NAME] [--host=HOST] [--force]
| Action | What it does |
|---|---|
bootstrap (default) |
init + scaffold in one go |
init |
Create the Dokku app + add the dokku git remote |
scaffold |
Create/update Procfile, nginx.conf, fpm_custom.conf, app.json |
Moving to FrankenPHP?
scaffoldstill writes the buildpack files (nginx + php-fpm). To put an app on FrankenPHP/Caddy instead — one long-lived process, no per-request PHP boot — follow docs/frankenphp-migration.md. Done on packages and zm; the scaffolder has not been taught the FrankenPHP shape yet. |config [KEY=value]| Show all config, or set one var | |storage [/host:/container]| List or add a persistent mount | |deploy|git push dokku main| |logs/ps/restart/destroy| App lifecycle |
- Preview by default. Without
--force, mutating steps are only listed. Add--forceto actually create the app, write files, and set config. --hostdefaults to thefsn1SSH alias; the app name is auto-detected from thedokkugit remote, else the directory name. Pass--app=ai-demoto override.- Requires SSH access as
dokku@<host>(test:ssh dokku@fsn1 apps:list).
Standalone app — happy path
bin/console dokku bootstrap --app=myapp --force # app + remote + scaffold files bin/console dokku config OPENAI_API_KEY=sk-... # set secrets (repeat per var) bin/console dokku deploy --force # git push dokku main bin/console dokku logs # watch
The app is served from public/ via heroku-php-nginx (see the generated
Procfile). The PHP buildpack runs composer install --no-dev on the server,
so require-dev packages (including this bundle) are NOT deployed.
Deploying an app that lives in a monorepo subdirectory
Dokku deploys whatever you git push, and dokku deploy runs a plain
git push dokku main. That only works when the app is its own git repo. If
the app is a subdirectory of a larger monorepo (e.g. demo/ inside
symfony/ai), a plain push would send the whole monorepo with the wrong root.
The fix: build a throwaway git repo from the app directory and push that.
Drop a bin/deploy script in the app (this is exactly what we use for the
symfony/ai demo → ai-demo.survos.com):
#!/usr/bin/env bash # Deploy a monorepo-subdir Symfony app to Dokku via a throwaway git repo. set -euo pipefail APP="${DOKKU_APP:-ai-demo}" DOKKU_HOST="${DOKKU_HOST:-fsn1}" cd "$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"; ROOT="$(pwd)" # 1) Config/secrets from .env.local (values never printed; .env.local stays gitignored) CFG=( APP_ENV=prod APP_DEBUG=0 ) if [ -f .env.local ]; then while IFS= read -r line; do case "$line" in OPENAI_API_KEY=*|MISTRAL_API_KEY=*|ANTHROPIC_API_KEY=*|CEREBRAS_API_KEY=*) key="${line%%=*}"; val="${line#*=}"; val="${val%\"}"; val="${val#\"}"; val="${val%\'}"; val="${val#\'}" CFG+=( "${key}=${val}" );; esac done < .env.local fi ssh "dokku@${DOKKU_HOST}" config:set --no-restart "${APP}" "${CFG[@]}" >/dev/null # 2) Throwaway repo built from THIS dir → push (triggers the build) TMP_GIT="${ROOT}/.git-deploy"; rm -rf "$TMP_GIT"; trap 'rm -rf "$TMP_GIT"' EXIT G() { git --git-dir="$TMP_GIT" --work-tree="$ROOT" "$@"; } G init -q -b main G add -A G add -f composer.lock # see gotcha below G -c user.email=deploy@survos.com -c user.name=deploy commit -q -m "deploy ${APP}" G remote add dokku "dokku@${DOKKU_HOST}:${APP}" G push -f dokku main
Run bin/console dokku scaffold --app=<app> --force once to generate the
Procfile/nginx.conf/app.json in the subdir, then deploy with bin/deploy.
(git subtree push --prefix=<dir> dokku main is an alternative, but the
throwaway repo is simpler and keeps the monorepo history untouched.)
A
bin/deploycan equally be a Castor task or a justfile recipe — plain bash just avoids an extra dependency.
Gotchas (learned deploying ai-demo)
-
Track
composer.lockfor apps. The PHP buildpack requires it. Monorepos often gitignorecomposer.lockglobally (correct for libraries); add a negation in the app's own.gitignoreso the app commits its lock:!composer.lock
-
app.jsonWEB_CONCURRENCYmust have avalue, not agenerator. The scaffolded template used"generator": "echo 5"; Dokku can't run generators non-interactively and the release fails with "required env var WEB_CONCURRENCY has no value … no TTY for prompt". Use:"WEB_CONCURRENCY": { "description": "workers", "value": "2" }
-
Trim
app.jsonfor minimal apps. The template'spredeployrunsimportmap:install,asset-map:compileanddoctrine:migrations:migrate. An app with no database should drop the migrations step (the AI demo only needsbin/console asset-map:compile).The template no longer declares
dokku-postgres/dokku-redisaddons orsecrets:decrypt-to-local. The convention is the system Postgres and Redis reached viaDATABASE_URL/REDIS_URLin Dokku config — the addon declarations were inert (Dokku does not auto-provision fromapp.json) and implied a wiring that did not exist. Add an addon back only if you genuinely want a Dokku-managed service for that app. -
Secrets: use
dokku config:set. Thebin/deployabove pulls them from.env.local, which stays gitignored and is never pushed. Set config before the push soAPP_ENV=prodis present at build time (asset compilation, cache warmup).The Symfony Vault is deprecated for our apps — don't add it to new ones. It was worth trying and it didn't pay off:
- It hides config from
dokku config:show. That is the tool everyone uses to inspect production, so a vaultedDATABASE_URLmakes an app look misconfigured when it is fine. This has cost real debugging time. - The security floor is unchanged.
SYMFONY_DECRYPTION_SECREThas to live in Dokku config anyway, so anyone who can read Dokku config can decrypt the vault. You end up maintaining two mechanisms with the weaker one's guarantees. - It adds a boot-time dependency.
secrets:decrypt-to-localmust succeed inpredeploybefore the app can start. - Sharp edge:
secrets:decrypt-to-localwrites.env.prod.local, not.env.local— a reliable source of confusion.
Apps still on the vault (
lingua,mediary,ssai) should migrate: read the value,dokku config:setit (a real env var takes precedence over the vault, so this is safe to do first and verify), then remove the vault entry. Several other apps carry vestigialconfig/secrets/prod/entries that are already overridden by Dokku config and can simply be deleted. - It hides config from
-
Consuming a fork live. If the app depends on an unreleased fork (e.g.
symfony/ai:dev-tac), the app'scomposer.jsonmust carry the VCSrepositoriesentry +minimum-stability: devso the buildpack'scomposer installcan fetch it on the server. No local paths (../) survive a Dokku build.
Verifying
bin/console dokku logs # or: ssh dokku@<host> logs <app> -t curl -sI http://<app>.<host>/ # expect 200
Further reading
- dokku CLI: https://github.com/SebastianSzturo/dokku-cli
- https://hamel.dev/blog/posts/dokku/
- Survos clusters: https://autobase.survos.com/clusters