dockerbasis

This commit is contained in:
mrbesen 2022-03-10 15:16:30 +01:00
commit e7c66c6ad5
4 changed files with 76 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "tictactoebot"]
path = tictactoebot
url = https://git.mrbesen.de/MrBesen/tictactoebot.git

55
Dockerfile Normal file
View File

@ -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 []

17
entry.sh Executable file
View File

@ -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

1
tictactoebot Submodule

@ -0,0 +1 @@
Subproject commit 188db932fbd69b53380fc989104895920c833ece