Containerfile: add basic configuration

This commit is contained in:
Syping 2026-03-21 17:20:04 +01:00
parent 1164b18fd5
commit 34996ba363

View file

@ -5,6 +5,7 @@ RUN apk add --no-cache \
cmake \ cmake \
curl-dev \ curl-dev \
git \ git \
jq \
libc++-dev \ libc++-dev \
llvm-libunwind-dev \ llvm-libunwind-dev \
ninja-build \ ninja-build \
@ -16,7 +17,7 @@ COPY cmake/ dtranslatebot/cmake/
COPY src/ dtranslatebot/src/ COPY src/ dtranslatebot/src/
ENV CC=clang CXX=clang++ ENV CC=clang CXX=clang++
ENV DPP_VERSION=10.1.4 ENV DPP_VERSION=10.1.4
RUN git clone https://github.com/brainboxdotcc/DPP.git --branch "v$DPP_VERSION" --depth=1 RUN git clone https://github.com/brainboxdotcc/DPP.git --branch "v$DPP_VERSION" --depth=1 --single-branch
RUN cmake \ RUN cmake \
-DAVX_TYPE=AVX0 \ -DAVX_TYPE=AVX0 \
-DBUILD_VOICE_SUPPORT=OFF \ -DBUILD_VOICE_SUPPORT=OFF \
@ -43,6 +44,7 @@ RUN cmake \
dtranslatebot dtranslatebot
RUN cmake --build dtranslatebot-build RUN cmake --build dtranslatebot-build
RUN cmake --install dtranslatebot-build --strip RUN cmake --install dtranslatebot-build --strip
RUN echo "{\"translator\":{\"type\":\"stub\"}}" | jq > dtranslatebot.json
# Create the dtranslatebot Container # Create the dtranslatebot Container
FROM alpine:3.23 FROM alpine:3.23
@ -57,6 +59,7 @@ COPY --from=build /opt/dtranslatebot/bin/dtranslatebot /opt/dtranslatebot/bin/
COPY --from=build /opt/dtranslatebot/lib/*.so /opt/dtranslatebot/lib/ COPY --from=build /opt/dtranslatebot/lib/*.so /opt/dtranslatebot/lib/
COPY --from=build /opt/dtranslatebot/lib/*.so.* /opt/dtranslatebot/lib/ COPY --from=build /opt/dtranslatebot/lib/*.so.* /opt/dtranslatebot/lib/
RUN adduser --disabled-password dtranslatebot RUN adduser --disabled-password dtranslatebot
WORKDIR /home/dtranslatebot
USER dtranslatebot USER dtranslatebot
ENTRYPOINT ["/opt/dtranslatebot/bin/dtranslatebot", "--wait-for-translator", "/home/dtranslatebot/dtranslatebot.json"] WORKDIR /home/dtranslatebot
COPY --from=build /build/dtranslatebot.json .
ENTRYPOINT ["/opt/dtranslatebot/bin/dtranslatebot", "--wait-for-translator", "dtranslatebot.json"]