Skip to content

Commit

Permalink
simplify docker run commands
Browse files Browse the repository at this point in the history
  • Loading branch information
fitztrev committed Nov 10, 2023
1 parent 58c49c8 commit 89edcc7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ docker compose run --rm ui bash -c "/lila/bin/trans-dump"
To install the development version of [Berserk](https://github.com/lichess-org/berserk) and run a sample script against your local development site:
```bash
docker run --rm -v $(pwd)/repos/berserk:/berserk -v $(pwd)/scripts:/scripts python:latest \
bash -c "cd /berserk && pip install -e . && python /scripts/berserk-example.py"
docker compose run --rm -w /berserk python \
bash -c "pip install -e . && python /scripts/berserk-example.py"
```
### Scala Metals (IDE helper):
Expand Down Expand Up @@ -162,19 +162,13 @@ Other Scalachess commands:

```bash
## compile
docker run --rm -v $(pwd)/repos/scalachess:/mnt \
sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.1_12_1.9.7_3.3.1 \
bash -c "cd /mnt && sbt compile"
docker compose run --rm -w /scalachess --entrypoint="sbt compile" lila
## test
docker run --rm -v $(pwd)/repos/scalachess:/mnt \
sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.1_12_1.9.7_3.3.1 \
bash -c "cd /mnt && sbt testKit/test"
docker compose run --rm -w /scalachess --entrypoint="sbt testKit/test" lila
## package
docker run --rm -v $(pwd)/repos/scalachess:/mnt \
sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.1_12_1.9.7_3.3.1 \
bash -c "cd /mnt && sbt package"
docker compose run --rm -w /scalachess --entrypoint="sbt package" lila
```

### Dartchess:
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ services:
networks:
- lila-network
volumes:
- ./repos/berserk:/berserk
- ./repos/lila-db-seed:/lila-db-seed
- ./scripts:/scripts
profiles:
- utils

Expand Down
7 changes: 4 additions & 3 deletions scripts/berserk-example.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import berserk
import pprint

session = None

# # For authenticated requests, specify your API token:
# # Create a token here: http://localhost:8080/account/oauth/token/create?description=Test+Berserk+Token
# # Create a token here: http://nginx/account/oauth/token/create?description=Test+Berserk+Token
# my_token = 'lip_abc123'
# session = berserk.TokenSession(my_token)
session = None

client = berserk.Client(session, base_url="http://host.docker.internal:8080")
client = berserk.Client(session, base_url="http://nginx")

# # Sample authenticated request:
# print('\n#### Me ####\n')
Expand Down

0 comments on commit 89edcc7

Please sign in to comment.