What happens
Following the production Docker guide, step 2 says to generate Passport keys with:
docker compose -f compose.prod.yaml run --rm app php artisan passport:keys --show
Laravel Passport's passport:keys command only accepts --force and --length, so this fails with:
The "--show" option does not exist.
It looks like it was modelled on key:generate --show, which does exist.
Where it appears
The same command is referenced in three places:
- Docs: https://docs.trypost.it/self-hosting/docker (step 2)
compose.prod.yaml, comment in the Passport section (line 58 on main)
docker/entrypoint.sh, the error printed when PASSPORT_PRIVATE_KEY / PASSPORT_PUBLIC_KEY are unset in production (line 95 on main)
The entrypoint one is the most important, because it's what people see at the moment they're stuck.
Suggested fix
Replace the command with something that works in the published image, for example:
docker compose -f compose.prod.yaml run --rm app sh -c \
'php artisan passport:keys --force >/dev/null && cat storage/oauth-private.key storage/oauth-public.key'
or with plain OpenSSL on the host, which needs nothing from the image:
openssl genrsa -out oauth-private.key 4096
openssl rsa -in oauth-private.key -pubout -out oauth-public.key
It would also help to document how to get the PEM into the env var. Passport already converts literal \n back into newlines, so this works:
awk 'NF {printf "%s\\n", $0}' oauth-private.key
Putting the keys in a .env next to compose.prod.yaml and referencing them as ${PASSPORT_PRIVATE_KEY} also keeps the private key out of the compose file itself.
Environment
- Image:
ghcr.io/trypostit/trypost:latest (v1.0.9)
compose.prod.yaml from main
- Docker Compose v2 on Debian (Proxmox LXC)
What happens
Following the production Docker guide, step 2 says to generate Passport keys with:
Laravel Passport's
passport:keyscommand only accepts--forceand--length, so this fails with:It looks like it was modelled on
key:generate --show, which does exist.Where it appears
The same command is referenced in three places:
compose.prod.yaml, comment in the Passport section (line 58 onmain)docker/entrypoint.sh, the error printed whenPASSPORT_PRIVATE_KEY/PASSPORT_PUBLIC_KEYare unset in production (line 95 onmain)The entrypoint one is the most important, because it's what people see at the moment they're stuck.
Suggested fix
Replace the command with something that works in the published image, for example:
or with plain OpenSSL on the host, which needs nothing from the image:
It would also help to document how to get the PEM into the env var. Passport already converts literal
\nback into newlines, so this works:Putting the keys in a
.envnext tocompose.prod.yamland referencing them as${PASSPORT_PRIVATE_KEY}also keeps the private key out of the compose file itself.Environment
ghcr.io/trypostit/trypost:latest(v1.0.9)compose.prod.yamlfrommain