2020-09-25 22:31:06 +00:00
|
|
|
# Builder image with development dependencies.
|
2021-11-06 13:47:23 +00:00
|
|
|
FROM ghcr.io/void-linux/void-linux:latest-mini-x86_64 as builder
|
2024-09-25 20:56:02 +00:00
|
|
|
RUN xbps-install -S
|
|
|
|
RUN xbps-install -yu xbps
|
2020-10-15 16:52:08 +00:00
|
|
|
RUN xbps-install -Syu
|
2021-11-06 13:47:23 +00:00
|
|
|
RUN xbps-install -Sy base-devel rustup cmake wget gnupg
|
2021-03-18 19:40:11 +00:00
|
|
|
RUN xbps-install -Sy openssl-devel libstdc++-devel
|
2021-04-20 21:35:12 +00:00
|
|
|
RUN rustup-init -qy
|
2020-08-23 20:59:09 +00:00
|
|
|
|
2020-08-27 01:22:40 +00:00
|
|
|
# Install tini for signal processing and zombie killing
|
2020-11-01 19:55:06 +00:00
|
|
|
ENV TINI_VERSION v0.19.0
|
|
|
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /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 . ./
|
2021-04-20 21:35:12 +00:00
|
|
|
RUN . /root/.cargo/env && cargo build --release
|
2020-08-27 01:22:40 +00:00
|
|
|
|
|
|
|
# Final image
|
2021-11-06 13:47:23 +00:00
|
|
|
FROM ghcr.io/void-linux/void-linux:latest-mini-x86_64
|
2024-09-25 21:06:20 +00:00
|
|
|
RUN xbps-install -S
|
|
|
|
RUN xbps-install -yu xbps
|
|
|
|
RUN xbps-install -Syu
|
2020-10-31 21:33:52 +00:00
|
|
|
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/
|
2020-08-23 20:59:09 +00:00
|
|
|
COPY --from=builder \
|
2020-08-27 01:22:40 +00:00
|
|
|
/usr/local/bin/tini \
|
2020-08-23 20:59:09 +00:00
|
|
|
/usr/local/bin/
|
2020-08-27 19:44:16 +00:00
|
|
|
|
|
|
|
ENV XDG_CACHE_HOME "/cache"
|
2020-10-15 16:52:08 +00:00
|
|
|
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" ]
|