Skip to content

Commit d733c0d

Browse files
committed
(FFM-5131) Make proxy port configurable for docker container
1 parent 3142185 commit d733c0d

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ services:
2020
- API_KEYS=${API_KEYS}
2121
- TARGET_POLL_DURATION=${TARGET_POLL_DURATION}
2222
- GENERATE_OFFLINE_CONFIG=${GENERATE_OFFLINE_CONFIG}
23+
- PORT=${PORT}
2324
build:
2425
context: ./
2526
dockerfile: ./Dockerfile

docker-entrypoint.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,16 @@ if [ -v target ]; then
3131
echo "* ${target},over_http" > /etc/pushpin/routes
3232
fi
3333

34+
# Update routes file to use $PORT if set
35+
if [ -w /etc/pushpin/routes ]; then
36+
if [ -n "${PORT}" ]; then
37+
echo "Setting internal relay proxy port to ${PORT}"
38+
sed -i \
39+
-e "s/8000/${PORT}/g" \
40+
/etc/pushpin/routes
41+
fi
42+
else
43+
echo "docker-entrypoint.sh: unable to write to /etc/pushpin/routes, readonly"
44+
fi
45+
3446
exec "$@"

tests/e2e/testhelpers/setup/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ ORG_IDENTIFIER=%s
3636
ADMIN_SERVICE_TOKEN=%s
3737
API_KEYS=%s
3838
AUTH_SECRET=my_secret
39-
REDIS_ADDRESS=redis:6379`
39+
REDIS_ADDRESS=redis:6379
40+
PORT=9000`
4041

4142
var generateOfflineConfigTemplate = `ACCOUNT_IDENTIFIER=%s
4243
ORG_IDENTIFIER=%s

0 commit comments

Comments
 (0)