-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile.bot
94 lines (79 loc) · 3.3 KB
/
Dockerfile.bot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
ARG PYTHON_VERSION=3.12
FROM python:$PYTHON_VERSION-slim-bookworm
LABEL AI Arena <staff@aiarena.net>
USER root
WORKDIR /root/
# Update system
RUN apt-get update \
&& apt-get upgrade --assume-yes --quiet=2 \
&& apt-get install --assume-yes --no-install-recommends --no-show-upgraded \
gnupg2 \
wget \
git \
procps \
# Required to build wheels of some packages on new python versions
g++ \
ffmpeg \
libsm6 \
libxext6 \
unzip \
&& rm -rf /var/lib/apt/lists/*
# Install protoc
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protoc-23.2-linux-x86_32.zip && \
unzip protoc-23.2-linux-x86_32.zip -d protoc3 && \
mv protoc3/bin/* /usr/bin/ && \
mv protoc3/include/* /usr/include/ && \
rm -rf protoc*
# Install Zulu openjdk-21
# https://docs.azul.com/core/install/debian#install-from-azul-apt-repository
RUN apt-get update
RUN apt install --assume-yes gnupg ca-certificates curl
RUN curl -s https://repos.azul.com/azul-repo.key | gpg --dearmor -o /usr/share/keyrings/azul.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/azul.gpg] https://repos.azul.com/zulu/deb stable main" | tee /etc/apt/sources.list.d/zulu.list
RUN apt-get update
RUN apt-get install --assume-yes zulu21-jdk
# Prepare NET installation
ADD https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
# Add NET runtimes
&& apt-get install --no-install-recommends --assume-yes dotnet-runtime-6.0 dotnet-sdk-7.0 dotnet-sdk-8.0 dotnet-sdk-9.0 \
# Install ML.NET
&& dotnet tool install -g mlnet-linux-x64 --version 16.15.1 \
&& rm -rf /var/lib/apt/lists/*
# Install nodejs
RUN wget -qO- https://deb.nodesource.com/setup_18.x | bash - \
&& apt install --assume-yes --no-install-recommends --no-show-upgraded nodejs
# Add local pyproject.toml and poetry.lock which contain bot requirements
COPY pyproject.toml poetry.lock ./
# # Merge client and bot requirements into pyproject.toml, generate a requirements.txt and install the packages globally
RUN pip install --upgrade --no-cache-dir pip && \
pip install --no-cache-dir poetry \
# Allows the final remove virtual env command
&& poetry config virtualenvs.in-project true \
# Export unified requirements as requirements.txt, this will not include dev dependencies
&& poetry export -f requirements.txt --output requirements.txt --without-hashes \
# Remove virtual environment and uninstall poetry
&& pip uninstall -y poetry \
&& rm -rf /root/.venv \
# Install requirements.txt globally
&& pip --default-timeout=1000 install --no-cache-dir -r requirements.txt \
&& pip install --force-reinstall protobuf \
&& pip uninstall -y s2clientprotocol \
# Remove cache created by poetry and pip
&& rm -rf /root/.cache \
&& rm -rf poetry.lock \
&& rm -rf pyproject.toml.lock \
&& rm -rf requirements.txt.lock
RUN git clone https://github.com/Blizzard/s2client-proto.git && \
cd s2client-proto && \
python setup.py install && \
cd .. \
&& rm -rf s2client-proto
RUN apt remove --yes wget \
unzip \
gnupg2 \
software-properties-common\
g++ && apt autoremove --yes \
&& rm -rf /var/lib/apt/lists/*