Skip to content

Commit 5c523f6

Browse files
committed
Chat fixed for Fly.io
1 parent 825cd2d commit 5c523f6

File tree

3 files changed

+13
-33
lines changed

3 files changed

+13
-33
lines changed

python/tutorials/chat/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ RUN pip install --no-cache-dir -r requirements.txt
77

88
COPY . .
99

10-
EXPOSE 8080
10+
EXPOSE 8000
1111

12-
CMD ["python", "./chat.py"]
12+
CMD ["python", "chat.py"]

python/tutorials/chat/chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,4 @@ def on_message(message: Message):
137137
),
138138
)
139139

140-
ft.app(port=8550, target=main, view=ft.WEB_BROWSER)
140+
ft.app(main)

python/tutorials/chat/fly.toml

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,16 @@ kill_timeout = 5
55
processes = []
66

77
[env]
8-
FLET_SERVER_PORT = "8080"
9-
FLET_FORCE_WEB_VIEW = "true"
8+
FLET_SESSION_TIMEOUT = "60"
109

11-
[experimental]
12-
allowed_public_ports = []
13-
auto_rollback = true
10+
[http_service]
11+
internal_port = 8000
12+
force_https = true
13+
auto_stop_machines = true
14+
auto_start_machines = true
15+
min_machines_running = 0
1416

15-
[[services]]
16-
http_checks = []
17-
internal_port = 8080
18-
processes = ["app"]
19-
protocol = "tcp"
20-
script_checks = []
21-
22-
[services.concurrency]
23-
hard_limit = 25
24-
soft_limit = 20
17+
[http_service.concurrency]
2518
type = "connections"
26-
27-
[[services.ports]]
28-
force_https = true
29-
handlers = ["http"]
30-
port = 80
31-
32-
[[services.ports]]
33-
handlers = ["tls", "http"]
34-
port = 443
35-
36-
[[services.tcp_checks]]
37-
grace_period = "1s"
38-
interval = "15s"
39-
restart_limit = 0
40-
timeout = "2s"
19+
soft_limit = 200
20+
hard_limit = 250

0 commit comments

Comments
 (0)