Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Commit 393a903

Browse files
committed
Updating container to listen based on a configurable host rather than 127.0.0.1 which does not accept external connections
Signed-off-by: Peter Baker <peter.baker122@csiro.au>
1 parent b4f19f8 commit 393a903

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

sample.config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
PREPPED_DATA_DIR = '/data'
33

44
[server_config]
5+
# This is the server listening host - recommended to use 0.0.0.0 in deployed
6+
# environments, but 127.0.0.1 might be more suitable for local environments
7+
HOST = '0.0.0.0'
58
TIFF_CACHE_DIR = '<some location to cache geotiffs>'
69
REGIONAL_CACHE_DIR = '<some location to cache regional datasets>'
710
DEBUG_MODE = 'false'

src/ReefGuideAPI.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,16 @@ function start_server(config_path)
303303
@info "Setting up admin routes..."
304304
setup_admin_routes(config)
305305

306+
# Which host should we listen on?
307+
host = config["server_config"]["HOST"]
308+
# Which port should we listen on?
306309
port = 8000
307-
@info "Initialisation complete, starting server on port $(port) with $(Threads.nthreads()) threads."
310+
311+
@info "Initialisation complete, starting server listening on host: $(host) at port $(port) with $(Threads.nthreads()) threads."
308312

309313
return serve(;
310314
middleware=[CorsMiddleware],
311-
host="127.0.0.1",
315+
host=host,
312316
port=port,
313317
parallel=Threads.nthreads() > 1,
314318
is_prioritized=(req::HTTP.Request) -> req.target == "/health"

0 commit comments

Comments
 (0)