Skip to content

Commit

Permalink
rename an env var of docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
TaiSakuma committed Feb 4, 2022
1 parent 31ce666 commit ab55eea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ You can configure the web app in the container with these variables.
| 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 |
| `API_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 PUBLIC_PATH=/nextline/ -e GRAPHQL_HTTP=http://localhost:5000/graphql ghcr.io/simonsobs/nextline-web
docker run -p 8080:80 -e PUBLIC_PATH=/nextline/ -e API_HTTP=http://localhost:5000/graphql ghcr.io/simonsobs/nextline-web
```

If you are on the localhost, the web app is running at <http://localhost:8080/nextline/>.
Expand Down
12 changes: 6 additions & 6 deletions docker/cmd.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/bash

##__________________________________________________________________||
GRAPHQL_HTTP_DEFAULT="http://localhost:8000"
API_HTTP_DEFAULT="http://localhost:8000"
PUBLIC_PATH_DEFAULT="/"

GRAPHQL_HTTP_PLACEHOLDER="graphql_http_placeholder"
API_HTTP_PLACEHOLDER="graphql_http_placeholder"
PUBLIC_PATH_PLACEHOLDER="/public_path_placeholder/"

HTML_DIR="/app/site"

##__________________________________________________________________||
if [ -z $GRAPHQL_HTTP ]
if [ -z $API_HTTP ]
then
echo 'Warning: $GRAPHQL_HTTP is not set!'
command="GRAPHQL_HTTP=$GRAPHQL_HTTP_DEFAULT"
echo 'Warning: $API_HTTP is not set!'
command="API_HTTP=$API_HTTP_DEFAULT"
echo + $command
eval $command
fi
Expand Down Expand Up @@ -55,7 +55,7 @@ fi
$command
for f in $(find . -type f);
do
command="sed -i \"s#$GRAPHQL_HTTP_PLACEHOLDER#$GRAPHQL_HTTP#g\" $f";
command="sed -i \"s#$API_HTTP_PLACEHOLDER#$API_HTTP#g\" $f";
echo + $command;
eval $command;
done
Expand Down

0 comments on commit ab55eea

Please sign in to comment.