Skip to content

Commit

Permalink
fix: expose udp port in dockerfile
Browse files Browse the repository at this point in the history
I think that could be the reason why the application does not work on
the Azure Container Instance.
  • Loading branch information
josecelano committed Dec 8, 2022
1 parent 90795c9 commit bbd8659
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ COPY --from=builder --chown=$RUN_AS_USER \
/app/torrust-tracker
RUN chown -R $RUN_AS_USER:$RUN_AS_USER /app
USER $RUN_AS_USER:$RUN_AS_USER
EXPOSE 6969
EXPOSE 6969/udp
EXPOSE 1212
ENTRYPOINT ["/app/torrust-tracker"]
17 changes: 9 additions & 8 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ And finally, you can run the container:

```s
docker run \
--publish 80:80/udp \
--publish 6969:6969/udp \
--publish 1212:1212 \
--volume torrustracker/test-volume:/app/storage \
registry.hub.docker.com/josecelano/torrust-tracker:0.4.0
Expand All @@ -65,25 +65,25 @@ Detach from container logs when the container starts. By default, the command li
```s
docker run \
--detach
--publish 80:80/udp \
--publish 6969:6969/udp \
--publish 1212:1212 \
--volume torrustracker/test-volume:/app/storage \
registry.hub.docker.com/josecelano/torrust-tracker:0.4.0
registry.hub.docker.com/josecelano/torrust-tracker:0.5.0
```

You should see something like this:

```s
$ docker run \ \
--publish 80:80/udp \
--publish 6969:6969/udp \
--publish 1212:1212 \
--volume torrustracker/test-volume:/app/storage \
registry.hub.docker.com/josecelano/torrust-tracker:0.4.0
registry.hub.docker.com/josecelano/torrust-tracker:0.5.0
[+] Running 2/2
⠿ Group intelligent-hawking Created 5.0s
⠿ intelligent-hawking Created 41.7s
2022-12-08T18:39:19.697869300+00:00 [torrust_tracker::logging][INFO] logging initialized.
2022-12-08T18:39:19.712651100+00:00 [torrust_tracker::jobs::udp_tracker][INFO] Starting UDP server on: 0.0.0.0:80
2022-12-08T18:39:19.712651100+00:00 [torrust_tracker::jobs::udp_tracker][INFO] Starting UDP server on: 0.0.0.0:6969
2022-12-08T18:39:19.712792700+00:00 [torrust_tracker::jobs::tracker_api][INFO] Starting Torrust API server on: 0.0.0.0:1212
2022-12-08T18:39:19.725124+00:00 [torrust_tracker::jobs::tracker_api][INFO] Torrust API server started
```
Expand All @@ -93,10 +93,10 @@ You can see the container with:
```s
$ docker ps
CONTAINER ID IMAGE COMMAND STATUS PORTS
intelligent-hawking registry.hub.docker.com/josecelano/torrust-tracker:0.4.0 Running 4.236.213.57:80->80/udp, 4.236.213.57:1212->1212/tcp
intelligent-hawking registry.hub.docker.com/josecelano/torrust-tracker:0.5.0 Running 4.236.213.57:6969->6969/udp, 4.236.213.57:1212->1212/tcp
```

After a while, you can use the tracker API `http://4.236.213.57:1212/api/stats?token=MyAccessToken` and the UDP tracker with your BitTorrent client using this tracker announce URL `udp://4.236.213.57:80/announce`.
After a while, you can use the tracker API `http://4.236.213.57:1212/api/stats?token=MyAccessToken` and the UDP tracker with your BitTorrent client using this tracker announce URL `udp://4.236.213.57:6969/announce`.

> NOTES:
>
Expand All @@ -105,6 +105,7 @@ After a while, you can use the tracker API `http://4.236.213.57:1212/api/stats?t
> - [Azure file share volume mount requires the Linux container run as root](https://learn.microsoft.com/en-us/azure/container-instances/container-instances-volume-azure-files#limitations).
> - It can take some minutes until the public IP for the ACI container is available.
> - You can use the Azure web UI to download files from the storage. For example, the SQLite database.
> - [It seems you can only expose web interfaces on port 80 on Azure Container Instances](https://stackoverflow.com/a/56768087/3012842). Not official documentation!
## Links

Expand Down

0 comments on commit bbd8659

Please sign in to comment.