Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fitztrev committed Mar 2, 2024
1 parent 30b3f8a commit 0b70e16
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
3 changes: 0 additions & 3 deletions conf/ci.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@ include "version"
user.password.bpass.secret = "9qEYN0ThHer1KWLNekA76Q=="

net.ratelimit = false

mongodb.uri = "mongodb://mongodb?appName=lila"
redis.uri = "redis://redis"
44 changes: 41 additions & 3 deletions docker/ci.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,49 @@
FROM sbtscala/scala-sbt:eclipse-temurin-jammy-21.0.2_13_1.9.9_3.4.0

RUN git clone --depth 1 https://github.com/lichess-org/lila.git /lila
# Install mongodb
# https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/
RUN apt-get update \
&& apt-get install gnupg curl -y \
&& curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \
--dearmor \
&& echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list \
&& apt-get update \
&& apt-get install -y mongodb-org \
&& apt-get clean \
&& mkdir -p /data/db

COPY conf/ci.conf /lila/conf/application.conf
# Install redis
# https://redis.io/docs/install/install-redis/install-redis-on-linux/
RUN apt install lsb-release curl gpg -y \
&& curl -fsSL https://packages.redis.io/gpg | gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list \
&& apt-get update \
&& apt-get install redis -y \
&& apt-get clean

RUN git clone --depth 1 https://github.com/lichess-org/lila-db-seed /lila-db-seed
WORKDIR /lila-db-seed
RUN apt install python3-pip -y \
&& pip3 install pymongo requests
RUN mongod --fork --logpath /var/log/mongod.log \
&& ./spamdb/spamdb.py \
--drop-db \
--password=password \
--su-password=password \
--streamers \
--coaches \
--tokens

## Pre-install dependencies for Berserk client
RUN pip3 install berserk

RUN git clone --depth 1 https://github.com/lichess-org/lila.git /lila
WORKDIR /lila

COPY conf/ci.conf /lila/conf/application.conf
RUN ./lila stage

ENTRYPOINT sleep 10 \
CMD mongod --fork --logpath /var/log/mongod.log \
&& redis-server --daemonize yes \
&& JAVA_OPTS="-Xms4g -Xmx4g" ./target/universal/stage/bin/lila -Dconfig.file="/lila/conf/application.conf" -Dlogger.file="/lila/conf/logger.dev.xml"

0 comments on commit 0b70e16

Please sign in to comment.