tenebrous-dicebot/Dockerfile

34 lines
1.2 KiB
Docker
Raw Permalink Normal View History

# Builder image with development dependencies.
2020-08-27 01:22:40 +00:00
FROM bougyman/voidlinux:glibc as builder
RUN xbps-install -Syu
RUN xbps-install -Sy base-devel rust cargo cmake wget gnupg
2021-03-18 19:40:11 +00:00
RUN xbps-install -Sy openssl-devel libstdc++-devel
2020-08-27 01:22:40 +00:00
# Install tini for signal processing and zombie killing
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/local/bin/tini
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
&& gpg --batch --verify /tini.asc /usr/local/bin/tini
RUN chmod +x /usr/local/bin/tini
2020-08-27 01:22:40 +00:00
# Build dicebot
RUN mkdir -p /root/src
WORKDIR /root/src
ADD . ./
RUN cargo build --release
2020-08-27 01:22:40 +00:00
# Final image
FROM bougyman/voidlinux:tiny
RUN xbps-install -Sy ca-certificates libstdc++
2020-08-27 01:22:40 +00:00
COPY --from=builder \
/root/src/target/release/dicebot \
/usr/local/bin/
COPY --from=builder \
2020-08-27 01:22:40 +00:00
/usr/local/bin/tini \
/usr/local/bin/
ENV XDG_CACHE_HOME "/cache"
ENV DATABASE_PATH "/cache/bot-db"
2020-08-27 01:22:40 +00:00
ENTRYPOINT [ "/usr/local/bin/tini", "-v", "--", "/usr/local/bin/dicebot", "/config/dicebot-config.toml" ]