-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
32 lines (25 loc) · 819 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 node:18-buster-slim as builder
ARG VERSION=17.0
ARG BUILD_PROFILE=x86-64-avx2
WORKDIR /chess
RUN apt-get update \
&& apt-get install -y wget build-essential\
&& rm -rf /var/lib/apt/lists/*
RUN wget "https://github.com/official-stockfish/Stockfish/archive/refs/tags/sf_$VERSION.tar.gz" && tar -xf "sf_$VERSION.tar.gz" -C /chess && rm *.gz
WORKDIR /chess/Stockfish-sf_$VERSION/src
RUN make net && make build ARCH=$BUILD_PROFILE
FROM node:20-buster-slim
ARG NODE_VERSION=20
ARG VERSION=17
WORKDIR /app
COPY --from=builder /chess/Stockfish-sf_$VERSION/src/stockfish ./stockfish
ENV NODE_ENV=production
ENV STOCKFISH_PATH=/app/stockfish
ENV STOCKFISH_VERSION=${VERSION}
WORKDIR /app/api
COPY ./api /app/api
RUN npm install -g pnpm
RUN pnpm install
EXPOSE 3000
EXPOSE 8080
ENTRYPOINT [ "npm", "start" ]