Please check out a newer attempt at using Docker for Lichess, or consult the Lichess Developer Onboarding Wiki.
lichocker - lichess.org run in a Docker container
- 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 (
git clone https://github.com/BrandonE/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
- Check out lila-ws, which manages Websockets.
git clone https://github.com/ornicar/lila-ws.git
- Add the following line to your
/etc/hosts
file:127.0.0.1 lichess-assets.local
To obtain the image you can build it yourself or retrieve it from docker hub
Run the following while in the lichocker directory: docker build --tag brandone211/lichess .
docker login
docker pull brandone211/lichess
The Docker Hub repository can be found here.
- 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 \
--mount type=bind,source=/YOUR/ABSOLUTE/PATH/TO/lila,target=/home/lichess/projects/lila \
--mount type=bind,source=/YOUR/ABSOLUTE/PATH/TO/lila-ws,target=/home/lichess/projects/lila-ws \
--publish 9663:9663 \
--publish 9664:9664 \
--name lichess \
--interactive \
--tty \
brandone211/lichess
- Wait until you see the following message:
--- (Running the application, auto-reloading is enabled) ---
[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0.0.0.0:9663
(Server started, use Enter to stop and go back to the console...)
- Navigate to http://localhost:9663 in your host machine's browser.
You can run fishnet (in another Docker container if desired) by following these instructions.
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/ABSOLUTE/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.
- 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