{"id":20804942,"url":"https://github.com/lichess-org/lila-docker","last_synced_at":"2025-04-05T10:07:22.969Z","repository":{"id":177764531,"uuid":"615849213","full_name":"lichess-org/lila-docker","owner":"lichess-org","description":"Lichess local development using Docker Compose.","archived":false,"fork":false,"pushed_at":"2025-03-27T01:54:41.000Z","size":1604,"stargazers_count":67,"open_issues_count":6,"forks_count":62,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-29T03:53:47.299Z","etag":null,"topics":["docker","docker-compose","lichess"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lichess-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-18T21:17:16.000Z","updated_at":"2025-03-29T00:44:14.000Z","dependencies_parsed_at":"2023-11-16T03:26:53.335Z","dependency_job_id":"ea86c4f9-e68f-47b6-b45c-d561bdd5c9f6","html_url":"https://github.com/lichess-org/lila-docker","commit_stats":null,"previous_names":["fitztrev/lichess-docker-compose","fitztrev/lila-docker","lichess-org/lila-docker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lichess-org%2Flila-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lichess-org","download_url":"https://codeload.github.com/lichess-org/lila-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318744,"owners_count":20919484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","lichess"],"created_at":"2024-11-17T19:12:31.851Z","updated_at":"2025-04-05T10:07:22.948Z","avatar_url":"https://github.com/lichess-org.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lila-docker\n\n[![Publish Image](https://github.com/lichess-org/lila-docker/actions/workflows/publish-image.yml/badge.svg)](https://github.com/lichess-org/lila-docker/actions/workflows/publish-image.yml)\n\nLichess development environment using Docker Compose, for developing on Mac, Linux, or Windows (via WSL).\n\nThe only requirement for running on your local machine is Docker Desktop, and optionally git. All the other dependencies (Scala, MongoDB, Node.js, etc) are installed and run in Docker containers.\n\n![image](https://github.com/user-attachments/assets/0192574a-4cb7-42da-a19e-e75af24b0565)\n\n## Running in Gitpod\n\nAs an alternative to running it on your local machine, you can use Gitpod (a free, online, VS Code-like IDE) for contributing. With a single click, it will launch a workspace and automatically:\n\n-   Clone the necessary Lichess repositories\n-   Install all the dependencies\n-   Seed your database with test data\n-   Start your development site\n\nClick here to create a workspace:\n\n[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/new/#https://github.com/lichess-org/lila-docker)\n\nAlso, see [gitpod-prebuilds.md](gitpod-prebuilds.md) for more information on how to use prebuilds to speed up your development.\n\n## Instructions\n\n1. Install [Docker Desktop](https://www.docker.com/products/docker-desktop/) and have it running\n\n1. Clone this repo:\n\n    ```bash\n    git clone https://github.com/lichess-org/lila-docker\n    ```\n\n1. Start the services\n\n    ```bash\n    cd lila-docker\n    ./lila-docker start\n    ```\n\n    Starting new services may take 5-10 minutes. Some services will start before others and you may see errors in the logs until everything comes online.\n\n    Lila requires about 12GB of RAM to build. Make sure there is enough RAM available, especially when using Docker Desktop, which allocates 50% of the available RAM by default.\n\n    Lila will be the last service to complete, at which point you can visit http://localhost:8080/ to see the site.\n\n### Stopping\n\nTo stop the containers, for later resuming via `./lila-docker start`:\n\n```bash\n./lila-docker stop\n```\n\nTo remove the containers:\n\n```bash\n./lila-docker down\n```\n\n### Adding a new service\n\nTo add a new optional service after the initial setup has already been done:\n\n```bash\n./lila-docker add-services\n```\n\nSelect the service you want to add from the list of options.\n\nNOTE: This will not affect the existing services, only the new ones among the selected services will be added.\n\n## URLs\n\nAlways available:\n\n| Service            | URL                    |\n| ------------------ | ---------------------- |\n| Main lila instance | http://localhost:8080/ |\n\nDepending on which optional services you start:\n\n| Service               | URL                                                      |\n| --------------------- | -------------------------------------------------------- |\n| Mongodb manager       | http://localhost:8081/                                   |\n| Email inbox           | http://localhost:8025/                                   |\n| lila-gif              | http://localhost:6175/image.gif?fen=4k3/6KP/8/8/8/8/7p/8 |\n| Picfit                | http://localhost:3001/healthcheck                        |\n| Elasticsearch manager | http://localhost:8092/                                   |\n| lila-search docs      | http://localhost:9673/docs/                              |\n| API docs              | http://localhost:8089/                                   |\n| Chessground           | http://localhost:8090/demo.html                          |\n| PGN Viewer            | http://localhost:8091/                                   |\n| InfluxDB              | http://localhost:8086/ (admin/password)                  |\n\n## Usage\n\n### Scala development:\n\nTo restart lila (after making changes to any Scala code):\n\n```bash\n./lila-docker lila restart\n```\n\n### UI (JS/CSS) development:\n\nTo watch for Typescript/SCSS changes and automatically recompile:\n\n```bash\n./lila-docker ui\n```\n\n### Updating Routes\n\nIf you edit the `conf/routes` file, you'll need to update the route cache.\n\n```bash\ndocker compose exec lila ./lila.sh playRoutes\n```\n\n### To update translation keys:\n\nAfter modifying a `translation/source/*.xml` file, run:\n\n```bash\ndocker compose run --rm -w /lila ui pnpm run i18n-file-gen\n```\n\n### Code formatting:\n\n```bash\n./lila-docker format\n```\n\n### Optional: Make the database persistent\n\n```bash\ndocker compose cp mongodb:/data/db ./database\n```\n\nThen in `docker-compose.yml`add `- ./database:/data/db` to mongodb volumes\n\n### Berserk (Python library):\n\nTo install the development version of [Berserk](https://github.com/lichess-org/berserk) and run a sample script against your local development site:\n\n```bash\ndocker compose run --rm -w /berserk python sh -c \"pip install -e . \u0026\u0026 python /scripts/berserk-example.py\"\ndocker compose run --rm -w /berserk python sh -c \"pip install -e . \u0026\u0026 python /scripts/berserk-connect-bots.py\"\n```\n\n### Scala Metals (IDE helper):\n\n1. In VS Code, open this `lila-docker` project and install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)\n2. Cmd+Shift+P \u003e \"Dev Containers: Rebuild and Reopen in Container\"\n3. A new VS Code window will open, attached to the container instead of your host machine\n4. File \u003e Open Folder \u003e \"/workspaces/lila-docker/repos/lila\" (or whichever Scala project you want to work on)\n5. Install + Enable the Scala Metals extension (Cmd+Shift+X \u003e \"Scala (Metals)\")\n6. Cmd+Shift+P \u003e \"Metals: Import build\"\n\nOnce the build has been imported, you should have code completion, go to definition, etc when you open a Scala file.\n\n### Scalachess:\n\nIf you're making changes to the Scalachess library, you can have lila use it instead of the published Maven version:\n\n1. Update the `build.sbt` file in the scalachess repo:\n\n    ```diff\n    -  ThisBuild / version           := \"15.6.7\"\n    +  ThisBuild / version           := \"my-test-1\"  # give it a custom version\n    ```\n\n2. Update the `Dependencies.scala` file in the lila repo:\n\n    ```diff\n    -  val chess = \"org.lichess\" %% \"scalachess\" % \"15.6.7\"\n    +  val chess = \"org.lichess\" %% \"scalachess\" % \"my-test-1\"\n    ```\n\n3. Publish the local scalachess changes and restart lila:\n\n    ```bash\n    docker compose exec -w /scalachess lila sbt publishLocal\n    docker compose restart lila\n    ```\n\nOther Scalachess commands:\n\n```bash\n## formatting\ndocker compose run --rm -w /scalachess --entrypoint=\"sbt check\" lila\ndocker compose run --rm -w /scalachess --entrypoint=\"sbt prepare\" lila\n\n## compile\ndocker compose run --rm -w /scalachess --entrypoint=\"sbt compile\" lila\n\n## test\ndocker compose run --rm -w /scalachess --entrypoint=\"sbt testKit/test\" lila\n\n## package\ndocker compose run --rm -w /scalachess --entrypoint=\"sbt package\" lila\n```\n\n### Developing Chessground or PGN-Viewer locally\n\nBy default, your local lila instance will use the version of chessground + pgn-viewer that are published to npm. If you want to make changes to either library and see them reflected in your local lila instance, you can do the following:\n\n1. Start lila-docker with the optional chessground and/or pgn-viewer services\n\n1. Have lila use the local copy:\n\n    ```bash\n    docker compose run --rm -w /lila ui bash -c \"pnpm link /chessground\"\n    ```\n\n1. Start the compilers in watch mode:\n\n    ```bash\n    docker compose run --rm -w /chessground ui bash -c \"pnpm install \u0026\u0026 pnpm run bundle \u0026\u0026 pnpm run compile --watch\"\n\n    docker compose run --rm -w /pgn-viewer ui bash -c \"pnpm install \u0026\u0026 pnpm run dist\"\n    ```\n\n    See the updated chessground demo: http://localhost:8090/demo.html\n    See the updated pgn-viewer demo: http://localhost:8091/\n\n1. Start the lila ui build in watch mode:\n\n    ```bash\n    ./lila-docker ui\n    ```\n\n   and when you refresh lila, it will use the local copy of chessground and/or pgn-viewer.\n\n### InfluxDB Monitoring\n\nTo view the InfluxDB monitoring dashboard, start your environment with the `Monitoring` service enabled. You can view the metrics at:\n\n1. http://localhost:8086 (admin/password)\n2. http://localhost:8080/prometheus-metrics/x\n3. or by running:\n\n    ```bash\n    curl --get http://localhost:8086/query \\\n        --header \"Authorization: Token secret\" \\\n        --data-urlencode \"db=kamon\"  \\\n        --data-urlencode \"q=show measurements;\"\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flichess-org%2Flila-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flichess-org%2Flila-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flichess-org%2Flila-docker/lists"}