Skip to content

Commit

Permalink
Set data release URL dynamically by env var DR_SERVER_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
manning-ncsa committed Jan 18, 2024
1 parent 0173be9 commit aa2d8c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ RUN npm install -g [email protected]
WORKDIR /opt
COPY --chown=des:des ./ ./

ARG DRSERVER=desdr-server.ncsa.illinois.edu
RUN find static/des_components -type f -exec sed -i "s/{{drserverbaseurl}}/${DRSERVER}/g" {} \;

RUN vulcanize static/des_components/elements.html \
--exclude static/bower_components/polymer/lib/legacy/ \
Expand All @@ -23,4 +21,4 @@ RUN pip install --no-cache-dir jsmin
## Copy source files
COPY --from=build /opt/ ./

CMD [ "python", "main.py" ]
CMD [ "bash", "start.sh" ]
12 changes: 12 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash


if [[ -z "$DR_SERVER_URL" ]]; then
DR_SERVER_URL=desdr-server.ncsa.illinois.edu
fi

set -euo pipefail

find static/des_components -type f -exec sed -i "s/{{drserverbaseurl}}/${DR_SERVER_URL}/g" {} \;

python main.py

0 comments on commit aa2d8c9

Please sign in to comment.