Skip to content

Commit

Permalink
set env vars for lila host
Browse files Browse the repository at this point in the history
  • Loading branch information
fitztrev committed Nov 25, 2023
1 parent c4c8136 commit cafb8c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion lila-docker
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit cafb8c4

Please sign in to comment.