From cafb8c4eaffb22c0736ca54845f1ce8e847cfebb Mon Sep 17 00:00:00 2001 From: Trevor Fitzgerald Date: Fri, 24 Nov 2023 20:59:14 -0500 Subject: [PATCH] set env vars for lila host --- README.md | 4 ++-- docker-compose.yml | 5 +++-- lila-docker | 7 ++++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4ad3c48e..b1c41e44 100644 --- a/README.md +++ b/README.md @@ -285,6 +285,6 @@ See the changes on the PGN Viewer demo page: http://localhost:8091/ 4. Run the app: ```bash - LICHESS_HOST=http://[your private IP]:8080 - flutter run --dart-define=LICHESS_HOST=$LICHESS_HOST --dart-define=LICHESS_WS_HOST=$LICHESS_HOST + flutter run --dart-define=LICHESS_HOST=$LICHESS_HOST --dart-define=LICHESS_WS_HOST=$LICHESS_WS_HOST ``` + * The `$LICHESS_HOST` and `$LICHESS_WS_HOST` will already be set on the container. \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 0f76c51f..589f4833 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -66,9 +66,10 @@ services: build: context: docker dockerfile: mobile.Dockerfile + environment: + - LICHESS_HOST=http://${LILA_HOSTNAME:-localhost}:8080 + - LICHESS_WS_HOST=ws://${LILA_HOSTNAME:-localhost}:8080 tty: true - networks: - - lila-network volumes: - ./repos/mobile:/app profiles: diff --git a/lila-docker b/lila-docker index 3425e49e..ab7751d0 100755 --- a/lila-docker +++ b/lila-docker @@ -87,12 +87,17 @@ run_hostname() { fi rust_cmd hostname + export $(cat .env | xargs) if [ ! -z "$(docker compose ps -a --services | xargs)" ]; then - export $(cat .env | xargs) docker compose down lila lila_ws nginx docker compose up -d lila lila_ws nginx fi + + if [ ! -z "$(docker compose ps mobile -a --services | xargs)" ]; then + docker compose down mobile + docker compose up -d mobile + fi } rust_cmd() {