diff --git a/README.md b/README.md index 10b6c354..9cd95854 100644 --- a/README.md +++ b/README.md @@ -28,17 +28,17 @@ Docker images of the Nextline front-end web app are created as You can configure the web app in the container with these variables. -| Environment variable | Default value | Description | -| ---------------------- | ----------------------- | ------------------------------ | -| `VUE_APP_PUBLIC_PATH` | `/` | Path in the URL of the web app | -| `VUE_APP_GRAPHQL_HTTP` | `http://localhost:8000` | URL of the GraphQL API server | +| Environment variable | Default value | Description | +| -------------------- | ----------------------- | ------------------------------ | +| `PUBLIC_PATH` | `/` | Path in the URL of the web app | +| `GRAPHQL_HTTP` | `http://localhost:8000` | URL of the GraphQL API server | For example, if you are to run the web app at the port `8080` with the path `/nextline/` and use the GraphQL API server at `http://localhost:5000/graphql`, you can do so with the following command. ```bash -docker run -p 8080:80 -e VUE_APP_PUBLIC_PATH=/nextline/ -e VUE_APP_GRAPHQL_HTTP=http://localhost:5000/graphql ghcr.io/simonsobs/nextline-web +docker run -p 8080:80 -e PUBLIC_PATH=/nextline/ -e GRAPHQL_HTTP=http://localhost:5000/graphql ghcr.io/simonsobs/nextline-web ``` If you are on the localhost, the web app is running at . diff --git a/docker/cmd.sh b/docker/cmd.sh index 7df2cfef..2c2486a6 100755 --- a/docker/cmd.sh +++ b/docker/cmd.sh @@ -1,26 +1,26 @@ #!/bin/bash ##__________________________________________________________________|| -VUE_APP_GRAPHQL_HTTP_DEFAULT="http://localhost:8000" -VUE_APP_PUBLIC_PATH_DEFAULT="/" +GRAPHQL_HTTP_DEFAULT="http://localhost:8000" +PUBLIC_PATH_DEFAULT="/" -VUE_APP_GRAPHQL_HTTP_PLACEHOLDER="graphql_http_placeholder" -VUE_APP_PUBLIC_PATH_PLACEHOLDER="/public_path_placeholder/" +GRAPHQL_HTTP_PLACEHOLDER="graphql_http_placeholder" +PUBLIC_PATH_PLACEHOLDER="/public_path_placeholder/" HTML_DIR="/app/site" ##__________________________________________________________________|| -if [ -z $VUE_APP_GRAPHQL_HTTP ] +if [ -z $GRAPHQL_HTTP ] then - echo 'Warning: $VUE_APP_GRAPHQL_HTTP is not set!' - command="VUE_APP_GRAPHQL_HTTP=$VUE_APP_GRAPHQL_HTTP_DEFAULT" + echo 'Warning: $GRAPHQL_HTTP is not set!' + command="GRAPHQL_HTTP=$GRAPHQL_HTTP_DEFAULT" echo + $command eval $command fi -if [ -z $VUE_APP_PUBLIC_PATH ] +if [ -z $PUBLIC_PATH ] then - command="VUE_APP_PUBLIC_PATH=$VUE_APP_PUBLIC_PATH_DEFAULT" + command="PUBLIC_PATH=$PUBLIC_PATH_DEFAULT" echo + $command eval $command fi @@ -31,14 +31,14 @@ then exit 1 fi -if [ "$VUE_APP_PUBLIC_PATH" != "$VUE_APP_PUBLIC_PATH_DEFAULT" ] +if [ "$PUBLIC_PATH" != "$PUBLIC_PATH_DEFAULT" ] then HTML_DIR_TEMP="$(mktemp -d)/site" command="mv $HTML_DIR $HTML_DIR_TEMP" echo + $command eval $command - HTML_DIR=$(echo $HTML_DIR/$VUE_APP_PUBLIC_PATH | tr -s /) + HTML_DIR=$(echo $HTML_DIR/$PUBLIC_PATH | tr -s /) HTML_DIR=${HTML_DIR%/} # e.g., /app/site/vue command="mkdir -p $(dirname $HTML_DIR)" echo + $command @@ -55,13 +55,13 @@ fi $command for f in $(find . -type f); do - command="sed -i \"s#$VUE_APP_GRAPHQL_HTTP_PLACEHOLDER#$VUE_APP_GRAPHQL_HTTP#g\" $f"; + command="sed -i \"s#$GRAPHQL_HTTP_PLACEHOLDER#$GRAPHQL_HTTP#g\" $f"; echo + $command; eval $command; done for f in $(find . -type f); do - command="sed -i \"s#$VUE_APP_PUBLIC_PATH_PLACEHOLDER#$VUE_APP_PUBLIC_PATH#g\" $f"; + command="sed -i \"s#$PUBLIC_PATH_PLACEHOLDER#$PUBLIC_PATH#g\" $f"; echo + $command; eval $command; done