Code Monkey home page Code Monkey logo

lichocker's Introduction

lichocker - lichess.org run in a Docker container

Prerequisites

  • Install Git.
  • Install Docker.
  • Recommended: Increase your Docker runtime memory to 4GB and your CPUs to 4 (Mac, Windows, and configure the docker-machine assigned memory and CPUs for VirtualBox).
  • Check out lichocker and open the directory in your terminal: cd /YOUR/PATH/TO/lichocker
  • Check out lila, the main project behind Lichess: git clone --recursive https://github.com/ornicar/lila.git
  • Use the default dev console script: cp lila/bin/dev.default lila/bin/dev && chmod +x lila/bin/dev
  • Use the default application configuration: cp lila/conf/application.conf.default lila/conf/application.conf
  • Add the following line to your /etc/hosts file: 127.0.0.1 lichess-assets.local

Obtaining the Docker image

Building the image

Run the following while in the lichocker directory: docker build --tag brandone211/lichess .

Retrieving from Docker Hub

docker login
docker pull brandone211/lichess

The Docker Hub repository can be found here.

Running

  • Run lila in a Docker container using the image obtained above, replacing the path to your local lila repository in the following command:
docker run \
    --volume ~/YOUR/PATH/TO/lila:/home/lichess/projects/lila \
    --publish 80:80 \
    --publish 9663:9663 \
    --name lichess \
    --interactive \
    --tty \
    brandone211/lichess
  • Enter run when you see the Scala Build Tool console appear: [lila] $

  • Wait until you see the following message:

--- (Running the application, auto-reloading is enabled) ---

[info] p.c.s.NettyServer - Listening for HTTP on /0.0.0.0:9663

(Server started, use Ctrl+D to stop and go back to the console...)
  • Navigate to http://localhost:9663 in your host machine's browser.

  • Enter evicted in the sbt console and re-run if you see the following error: [error] version 2.11.12, library jar: /home/lichess/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.12.jar, compiler jar: /home/lichess/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.11.12.jar

Optional: Setup fishnet for server side analysis and play

You can run fishnet (in another Docker container if desired) by following these instructions.

Rebuilding Lichess

Because your lila directory exists on your host machine and is mounted onto the container, you can modify the code and rebuild on the host machine and it will take effect on the container. Run ~/YOUR/PATH/TO/lila/ui/build to update the client side modules. Auto-reloading is enabled for the server side Scala code via sbt.

For more information, including the guide used to create lichocker, please see the Lichess Development Onboarding instructions.

Other Commands

  • Exiting the Docker container: Ctrl+C
  • Stopping the Docker container: docker stop lichess
  • Restarting the Docker container: docker start lichess --attach --interactive
  • View the output of the running Docker container that you previously exited: docker attach lichess
  • Remove the Docker container to mount a different volume: docker rm lichess

lichocker's People

Contributors

brandone avatar udaykrishna avatar nicals avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.