dockerbasis
This commit is contained in:
commit
e7c66c6ad5
|
@ -0,0 +1,3 @@
|
|||
[submodule "tictactoebot"]
|
||||
path = tictactoebot
|
||||
url = https://git.mrbesen.de/MrBesen/tictactoebot.git
|
|
@ -0,0 +1,55 @@
|
|||
|
||||
FROM debian:bullseye as builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN printf "%s\n" "deb http://deb.debian.org/debian bullseye main" \
|
||||
"deb http://deb.debian.org/debian-security/ bullseye-security main" \
|
||||
"deb http://deb.debian.org/debian bullseye-updates main" \
|
||||
"deb http://deb.debian.org/debian bullseye-backports main" \
|
||||
>/etc/apt/sources.list
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
make \
|
||||
# nlohmann-json3-dev=3.7.3-1 \
|
||||
libcurl4-openssl-dev \
|
||||
g++ \
|
||||
git \
|
||||
ca-certificates \
|
||||
&& apt-get -qq -y autoremove --purge \
|
||||
&& apt-get -qq clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY tictactoebot/ .
|
||||
|
||||
# install json lib
|
||||
RUN git clone --progress --verbose --branch "v3.7.3" --depth 1 https://github.com/nlohmann/json.git
|
||||
RUN ln -s /app/json/include/nlohmann TAPI/include/
|
||||
|
||||
RUN make -j
|
||||
|
||||
|
||||
FROM debian:bullseye
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN printf "%s\n" "deb http://deb.debian.org/debian bullseye main" \
|
||||
"deb http://deb.debian.org/debian-security/ bullseye-security main" \
|
||||
"deb http://deb.debian.org/debian bullseye-updates main" \
|
||||
"deb http://deb.debian.org/debian bullseye-backports main" \
|
||||
>/etc/apt/sources.list
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
libcurl4-openssl-dev \
|
||||
ca-certificates \
|
||||
&& apt-get -qq -y autoremove --purge \
|
||||
&& apt-get -qq clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=builder /app/tictactoebot ./
|
||||
COPY entry.sh ./
|
||||
|
||||
ENTRYPOINT ["/app/entry.sh"]
|
||||
CMD []
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
|
||||
token=""
|
||||
if [ "$#" -eq "1" ]; then
|
||||
token="$1"
|
||||
elif [ -v APITOKEN ]; then
|
||||
token="$APITOKEN"
|
||||
else
|
||||
echo "expecting api token (APITOKEN env or argument)"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
umask 277
|
||||
echo "token=$token" > tictactoebot.conf
|
||||
|
||||
|
||||
./tictactoebot
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 188db932fbd69b53380fc989104895920c833ece
|
Loading…
Reference in New Issue