Many thanks for the answer. As a copy+paste pro, I didn’t forget the -ti of course. Anyway, I finally got Tryton to work. Don’t ask me what I did wrong the first few times I tried.
I did it with this deploy.sh script:
#!/bin/sh
# Remove existing containers if they exist
docker rm -f tryton-postgres tryton tryton-cron tryton-postgres-1 2>/dev/null
docker ps -a --filter "ancestor=tryton/tryton" --format "{{.ID}}" | xargs docker rm -f
# Start PostgreSQL
docker run --name tryton-postgres -e POSTGRES_PASSWORD=test1234 -e POSTGRES_DB=tryton -d postgres
# Wait for PostgreSQL to be ready
echo "Waiting for PostgreSQL to be ready..."
until docker exec tryton-postgres pg_isready -U postgres; do
sleep 2
done
# Initialize Tryton Database
docker run --link tryton-postgres:postgres -e DB_PASSWORD=test1234 -it tryton/tryton trytond-admin -d tryton --all
# Start Tryton Server
docker run --name tryton -p 9090:8000 --link tryton-postgres:postgres -e DB_PASSWORD=test1234 -d tryton/tryton
# Start Tryton Cron
docker run --name tryton-cron --link tryton-postgres:postgres -e DB_PASSWORD=test1234 -d tryton/tryton trytond-cron -d tryton