-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
32 lines (27 loc) · 907 Bytes
/
Dockerfile
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
FROM python:3.9
RUN apt-get update -y && \
apt-get upgrade -y
# Build stockfish binary
ARG STOCKFISH_BIN_URL
WORKDIR /tmp
RUN if [ -z ${STOCKFISH_BIN_URL} ]; then \
wget https://github.com/official-stockfish/Stockfish/archive/refs/tags/sf_16.1.zip && \
unzip sf_16.1.zip && \
cd Stockfish-sf_16.1/src && \
make build ARCH=x86-64-modern && \
cp stockfish /usr/local/bin/stockfish && \
rm -rf /tmp/*; \
else \
wget ${STOCKFISH_BIN_URL} -O /usr/local/bin/stockfish && \
chmod +x /usr/local/bin/stockfish; \
fi
# Copy files for websocket server
WORKDIR /stockfish-socket-server
ENV PYTHONPATH=/stockfish-socket-server
COPY . .
# install dependencies
RUN pip3 install --upgrade pip && \
pip3 install --no-cache-dir -r requirements.txt
# Expose port 5000 and override entrypoint
EXPOSE 5000
ENTRYPOINT ["/bin/bash", "-l", "-c"]