Try to add stdin_open: true
and tty: true
into your docker-compose.yml. It will enable interactive shell.
services:
arrow-working:
image: php:8.1.11-fpm-alpine
arrow-not-working:
image: postgres:15.2
stdin_open: true
tty: true
environment:
POSTGRES_PASSWORD: foo