Chris G.
Chris G.

Reputation: 25974

Dockerfile Flutter web for production - not for testing or development

I am trying to docker the flutter example app, using the following:

flutter build web

Dockerfile:

FROM nginx:1.21.1-alpine
COPY ./web /usr/share/nginx/html

But it just shows a blank page - it runs fine with flutter run, do you know how to run flutter web for production in container/Dockerfile?

Upvotes: 2

Views: 509

Answers (1)

Huthaifa Muayyad
Huthaifa Muayyad

Reputation: 12373

You need to copy ./build/web after building. The web folder contains an empty index.html, and used for adding JS dependancies..etc. The actual compiled folder should be inside build/web/.

Upvotes: 2

Related Questions