Skip to content

Commit 4782ace

Browse files
authored
Update Fly.io instructions (#169)
1 parent 363fae9 commit 4782ace

File tree

3 files changed

+25
-14
lines changed

3 files changed

+25
-14
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Add `ex_webrtc` to the list of dependencies in `mix.exs`
1818
```elixir
1919
def deps do
2020
[
21-
{:ex_webrtc, "~> 0.5.0"}
21+
{:ex_webrtc, "~> 0.6.0"}
2222
]
2323
end
2424
```

guides/deploying/fly.md

+23-12
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
Elixir WebRTC-based apps can be easily deployed on [Fly.io](https://fly.io)!
44

5-
There are just two things you need to do:
5+
There are just three things you need to do:
66

77
* configure a STUN server both on the client and server side
88
* use a custom Fly.io IP filter on the server side
9-
10-
In theory, configuring a STUN server just on one side should be enough but we recommend doing it on both sides.
9+
* slightly modify the auto-generated Dockerfile
1110

1211
In JavaScript code:
1312

@@ -32,19 +31,31 @@ ip_filter = Application.get_env(:your_app, :ice_ip_filter)
3231
In `runtime.exs`:
3332

3433
```elixir
35-
if System.get_env("FLY_IO") do
34+
if System.get_env("FLY_APP_NAME") do
3635
config :your_app, ice_ip_filter: &ExWebRTC.ICE.FlyIpFilter.ip_filter/1
3736
end
3837
```
3938

40-
In fly.toml:
39+
Now:
40+
1. Run `fly launch`. It will generate a Dockerfile that will fail to build.
41+
2. Introduce the following changes
4142

42-
```toml
43-
[env]
44-
# add one additional env
45-
FLY_IO = 'true'
46-
```
43+
```diff
44+
- ARG ELIXIR_VERSION=1.16.0
45+
- ARG OTP_VERSION=26.2.1
46+
- ARG DEBIAN_VERSION=bullseye-20231009-slim
47+
+ ARG ELIXIR_VERSION=1.17.2
48+
+ ARG OTP_VERSION=27.0.1
49+
+ ARG DEBIAN_VERSION=bookworm-20240701-slim
50+
51+
# when building on arm64, you will also need to add libsrtp2-dev
52+
- RUN apt-get update -y && apt-get install -y build-essential git \
53+
- && apt-get clean && rm -f /var/lib/apt/lists/*_*
54+
+ RUN apt-get update -y && apt-get install -y build-essential git pkg-config libssl-dev \
55+
+ && apt-get clean && rm -f /var/lib/apt/lists/*_*
56+
```
57+
58+
3. Run `fly deploy` to retry.
4759

4860
That's it!
49-
No special UDP port exports or dedicated IP address are needed.
50-
Just run `fly launch` and enjoy your deployment :)
61+
No special UDP port exports or dedicated IP address are needed :)

mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
defmodule ExWebRTC.MixProject do
22
use Mix.Project
33

4-
@version "0.5.0"
4+
@version "0.6.0"
55
@source_url "https://github.com/elixir-webrtc/ex_webrtc"
66

77
def project do

0 commit comments

Comments
 (0)