I was trying to run a flutter web application but I can't see it running in localhost.
I have this message that is running but I can't see it in my browser.
dashboard_1 | lib/main.dart is being served at http://localhost:8080
Dockerfile
FROM cirrusci/flutter AS build
RUN apt update && apt install -y nginx
RUN flutter channel beta
RUN flutter upgrade
RUN flutter config --enable-web
RUN mkdir /app/
COPY . /app/
WORKDIR /app/
RUN flutter build web
docker-compose.yml
version: '3.1'
services:
dashboard:
build: .
restart: on-failure
ports:
- "8080:8080"
command: >
sh -c "flutter pub get && flutter run -d web-server --web-port 8080"
localhost" at startup, it probably won't be reachable from outside the container; you need to reconfigure it somehow to listen to (or set the bind address to) 0.0.0.0 instead. See for example Why 0.0.0.0 is working and localhost or 127.0.01 is not.