Skip to content

Commit b902262

Browse files
committed
feat: [#236] make Docker Compose ports dynamic using Tera variables
- Replace hardcoded UDP ports (6868, 6969) with loop over udp_tracker_ports - Replace hardcoded HTTP port (7070) with loop over http_tracker_ports - Replace hardcoded API port (1212) with http_api_port variable - Add descriptive comments explaining dynamic configuration - Phase 4 complete: Template now renders ports from context
1 parent 5909c0b commit b902262

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

templates/docker-compose/docker-compose.yml.tera

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,16 @@ services:
3838
networks:
3939
- backend_network
4040
ports:
41-
- 6868:6868/udp
42-
- 6969:6969/udp
43-
- 7070:7070
44-
- 1212:1212
41+
# UDP Tracker Ports (dynamically configured)
42+
{%- for port in udp_tracker_ports %}
43+
- {{ port }}:{{ port }}/udp
44+
{%- endfor %}
45+
# HTTP Tracker Ports (dynamically configured)
46+
{%- for port in http_tracker_ports %}
47+
- {{ port }}:{{ port }}
48+
{%- endfor %}
49+
# HTTP API Port (dynamically configured)
50+
- {{ http_api_port }}:{{ http_api_port }}
4551
volumes:
4652
- ./storage/tracker/lib:/var/lib/torrust/tracker:Z
4753
- ./storage/tracker/log:/var/log/torrust/tracker:Z

0 commit comments

Comments
 (0)