Dockerize web-based Flet Application
See original GitHub issueI am not a really expert on docker but following the https://flet.dev/docs/guides/python/deploying-web-app/fly-io, I wanted to try my demo in my own computer. When I run the app from my local virtual env, the web app is displayed without problem. However, when I try to run it from a docker container, even when the container is running without issues, it give me error: (failed)net::ERR_EMPTY_RESPONSE
Docker commands used to create the image and run the container docker build --tag flet-app:latest . docker run -it -p 62590:62590 -p 8080:8080 flet-app
Source Code
import flet as ft
def main(page: ft.Page):
page.add(ft.Text(value="Hello world from containerized Flet app!"))
ft.app(target=main, view=ft.WEB_BROWSER)
dockerfile
# syntax=docker/dockerfile:1
FROM python:3.8-slim-buster
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY . .
EXPOSE 8080 62590
CMD ["python", "./app/main.py"]
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Docker | JetBrains Fleet Documentation
Docker is a tool for deploying and running executables in isolated and reproducible environments. This may be useful, for example, ...
Read more >linuxserver/fleet - Docker Image
Fleet - an online web interface which displays all of our maintained images. GitHub - view the source for all of our repositories....
Read more >Deploying a scalable web application with Docker and ...
Deploying a scalable web application with Docker and Kubernetes. Learn how to test and deploy a Node.js app using containers and an ...
Read more >Docker Provider | Fleet and Elastic Agent Guide [master]
Manage Elastic Agents in Fleet ... Provides inventory information from Docker. ... For example, the Docker provider provides the following inventory:.
Read more >Part 53 - Dockerize FleetMS (SpringBoot) With MySQL Database
This is Part 53 of our complete application in Spring Boot (FleetMS version 2). In this part, we would learn how to dockerize...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think the key here is that you start your app with
Then you don’t need to expose 62590 - which is pointless anyway, because unless you specify the port for ft.app(…) explicitly, fletd starts on a random port which your Docker will never know about.
At any rate, this way, my brief test worked.
Try this Dockerfile which works great for Fly.io environment. Let me know if that worked.