I'm working with a Docker container that requires me to respond to some prompts during development, but the prompts are showing up in the logs instead of the console. I've tried running the container with the `-it` option, but I still can't access the prompts. Does anyone know how to address this issue?
2 Answers
How are you starting your development environment? Could you share your Docker Compose setup? It might help figure out what's going wrong.
Why do you need to answer these prompts at all? Wouldn't it be easier to just include the necessary settings in a configuration file?
In this case, I can't provide the prompt answers upfront because I'm dealing with some database migrations that have to be confirmed at runtime. The framework prompts for those actions, so I need to interact with it.
Sure! Here's the Docker Compose configuration I'm using:
```yaml
payload:
build: .
ports:
- '3000:3000'
volumes:
- images:/app/media
depends_on:
- postgres
env_file:
- .env
```
And this is in my `docker-compose.dev.yml`:
```yaml
services:
payload:
build:
target: development
develop:
watch:
- action: sync
path: .
target: /app
ignore: node_modules
stdin_open: true
tty: true
```
I run it with `docker compose -f docker-compose.yml -f docker-compose.dev.yml up`.