How to restart flutter app in docker container?

Viewed 285

I am trying to restart flutter application running in Docker.

I specified stdin_open and tty to true in docker-compose.yml file

  • This is the only one place in docker-compose.yml where I've specified stdin and tty.

    app:
      build:
        context: app
      restart: always
      stdin_open: true
      tty: true
      volumes:
        - ./app:/build
      ports:
        - "8080:8080"
      env_file:
        - ./env/flutter.env
      command: >
        sh -c "flutter pub get
        && flutter run -d web-server --web-port 8080 --web-hostname 0.0.0.0"
      depends_on:
        - server
    

Running flutter web with docker-compose

On the screen above it is visible that I cannot restart an application this way.

I have to do it manually by using command: docker-compose up --detach --build

Is there any way I can interact with this container and restart app by pressing "R" ?

1 Answers

Try this:

docker attach <container>

Press R. Press Ctrl-P Ctrl-Q to detach.

Related