Skip to content

Commit c623e24

Browse files
committed
(FFM-5131) Configurable docker container port
1 parent e558981 commit c623e24

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

config/pushpin/pushpin.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ stats_connection_ttl=120
1919
services=condure,zurl,pushpin-proxy,pushpin-handler
2020

2121
# plain HTTP port that mongrel2 should listen on
22-
http_port=7999
22+
http_port=7000
2323

2424
# list of HTTPS ports that mongrel2 should listen on (you must have certs set)
2525
https_ports=443

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727
volumes:
2828
- ${CONFIG_VOLUME:-./config:/config}
2929
ports:
30-
- "7000:7000"
30+
- 7000:${PORT:-7000}
3131

3232
redis:
3333
image: "redis:latest"

docker-entrypoint.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ if [ -w /etc/pushpin/pushpin.conf ]; then
2020
-e 's/push_in_http_addr=.*/push_in_http_addr=0.0.0.0/' \
2121
-e 's/push_in_sub_specs=.*/push_in_sub_spec=tcp:\/\/\*:5562/' \
2222
-e 's/command_spec=.*/command_spec=tcp:\/\/\*:5563/' \
23-
-e 's/^http_port=.*/http_port=7999/' \
2423
/etc/pushpin/pushpin.conf
2524
else
2625
echo "docker-entrypoint.sh: unable to write to /etc/pushpin/pushpin.conf, readonly"
@@ -31,16 +30,17 @@ if [ -v target ]; then
3130
echo "* ${target},over_http" > /etc/pushpin/routes
3231
fi
3332

34-
# Update routes file to use $PORT if set
35-
if [ -w /etc/pushpin/routes ]; then
33+
# Update pushpin.conf file to use $PORT for http_port
34+
if [ -w /etc/pushpin/pushpin.conf ]; then
3635
if [ -n "${PORT}" ]; then
37-
echo "Setting internal relay proxy port to ${PORT}"
36+
echo "Listening for requests on port ${PORT}"
3837
sed -i \
39-
-e "s/8000/${PORT}/g" \
40-
/etc/pushpin/routes
38+
-e "s/http_port=7000/http_port=${PORT}/" \
39+
/etc/pushpin/pushpin.conf
40+
export PORT=
4141
fi
4242
else
43-
echo "docker-entrypoint.sh: unable to write to /etc/pushpin/routes, readonly"
43+
echo "docker-entrypoint.sh: unable to write to /etc/pushpin/pushpin.conf, readonly"
4444
fi
4545

4646
exec "$@"

start.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22
{ ./app/ff-proxy; } &
3-
{ pushpin --port localhost:7000; } &
3+
{ pushpin; } &
44
wait -n
55
pkill -P $$

0 commit comments

Comments
 (0)