File tree Expand file tree Collapse file tree 6 files changed +15
-14
lines changed Expand file tree Collapse file tree 6 files changed +15
-14
lines changed Original file line number Diff line number Diff line change 1
1
# Set your appropriate values and save as `.env`
2
- EPPO_API_HOST=localhost
3
- EPPO_API_PORT=5000
2
+ EPPO_BASE_URL=localhost:5000
4
3
EPPO_API_KEY=A123456780
5
4
6
5
SDK_RELAY_HOST=localhost
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ COPY --chmod=755 build-and-run.sh /
22
22
RUN composer install
23
23
24
24
ENV SDK_RELAY_HOST=0.0.0.0
25
- ENV EPPO_API_HOST=host.docker.internal
26
25
27
26
EXPOSE $SDK_RELAY_PORT
28
27
Original file line number Diff line number Diff line change @@ -13,6 +13,6 @@ docker run -p $SDK_RELAY_PORT:$SDK_RELAY_PORT \
13
13
-e SDK_REF \
14
14
-e SDK_RELAY_PORT \
15
15
--name php-relay \
16
- -d \
16
+ -d --rm \
17
17
-t Eppo-exp/php-sdk-relay:$VERSION && \
18
18
echo " Container running"
Original file line number Diff line number Diff line change @@ -10,8 +10,7 @@ class Config
10
10
public function __construct ()
11
11
{
12
12
$ this ->apiKey = $ _ENV ["EPPO_API_KEY " ] ?? "NOKEYSPECIFIED " ;
13
- $ apiHost = $ _ENV ["EPPO_API_HOST " ] ?? "localhost " ;
14
- $ apiPort = $ _ENV ["EPPO_API_PORT " ] ?? "5000 " ;
15
- $ this ->apiServer = "http:// $ {apiHost}: $ {apiPort}" ;
13
+ $ apiServer = $ _ENV ["EPPO_BASE_URL " ] ?? "localhost:5000 " ;
14
+ $ this ->apiServer = "http:// $ {apiServer}" ;
16
15
}
17
16
}
Original file line number Diff line number Diff line change @@ -183,12 +183,13 @@ The test runner sends assignment and bandit action requests to the SDK Relay Ser
183
183
184
184
#### Configuration
185
185
186
- | Variable Name | Type | Description | Default |
187
- | ---------------- | ------ | ------------------------- | ----------- |
188
- | ` SDK_RELAY_HOST ` | string | Hostname for relay server | ` localhost ` |
189
- | ` SDK_RELAY_PORT ` | number | Port for relay server | 4000 |
190
- | ` EPPO_API_HOST ` | string | Hostname for api server | ` localhost ` |
191
- | ` EPPO_API_PORT ` | number | Port for api server | 5000 |
186
+ | Variable Name | Type | Default | Description |
187
+ | ---------------- | ------ | ---------------- | ----------------------------------------------------------------------- |
188
+ | ` SDK_RELAY_HOST ` | string | ` localhost ` | Hostname for relay server |
189
+ | ` SDK_RELAY_PORT ` | number | 4000 | Port for relay server |
190
+ | ` EPPO_BASE_URL ` | string | ` localhost:5000 ` | Base URL for api server, built from ` EPPO_API_HOST ` and ` EPPO_API_PORT ` |
191
+ | ` EPPO_API_HOST ` | string | ` localhost ` | Hostname for api server |
192
+ | ` EPPO_API_PORT ` | number | 5000 | Port for api server |
192
193
193
194
#### API
194
195
Original file line number Diff line number Diff line change 63
63
# Allow env variables to be overwritten, then export to this shell.
64
64
export EPPO_API_HOST=" ${EPPO_API_HOST:- localhost} "
65
65
export EPPO_API_PORT=" ${EPPO_API_PORT:- 5000} "
66
+ export EPPO_BASE_URL=" ${EPPO_API_HOST} :${EPPO_API_PORT} "
66
67
67
68
export SDK_RELAY_HOST=" ${SDK_RELAY_HOST:- localhost} "
68
69
export SDK_RELAY_PORT=" ${SDK_RELAY_PORT:- 4000} "
@@ -137,7 +138,9 @@ case "$command" in
137
138
BUILD_AND_RUN_PLATFORM=build-and-run-${EPPO_SDK_PLATFORM} .sh
138
139
if [ -f docker-run.sh ]; then
139
140
echo " ... Starting SDK Relay via docker launch script"
140
- ./docker-run.sh >> ${RUNNER_DIR} /logs/sdk.log 2>&1 &
141
+
142
+ # Docker containers need to point at host.docker.internal instead of localhost
143
+ EPPO_BASE_URL=host.docker.internal:${EPPO_API_PORT} EPPO_API_HOST=host.docker.internal ./docker-run.sh >> ${RUNNER_DIR} /logs/sdk.log 2>&1 &
141
144
elif [ -f ${BUILD_AND_RUN_PLATFORM} ]; then
142
145
echo " ... Starting SDK Relay via platform build-and-run script"
143
146
./${BUILD_AND_RUN_PLATFORM} >> ${RUNNER_DIR} /logs/sdk.log 2>&1 &
You can’t perform that action at this time.
0 commit comments