-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (25 loc) · 981 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM rust:latest as cargo-build
WORKDIR /usr/src/nmmdg
COPY Cargo.toml Cargo.lock ./
RUN mkdir src/
RUN echo "#[cfg(test)] fn main() {println!(\"if you see this, the build broke\")}" > src/lib.rs
RUN cargo build --release
RUN rm -f target/release/deps/no_more_mr_dice_guy* src/lib.rs
COPY . .
RUN touch src/lib.rs
RUN cargo build --release --offline
FROM ubuntu:rolling
LABEL org.opencontainers.image.source=https://github.com/LunNova/no-more-mr-dice-guy
RUN cat /etc/passwd && cat /etc/group && \
apt-get update && apt-get install adduser libssl3 libcurl4 -y && rm -rf /var/lib/apt/lists/* && \
groupadd -o -g 1000 nmmdg && \
passwd -l ubuntu && \
mv /home/ubuntu /home/nmmdg && \
usermod --shell /bin/sh --home /home/nmmdg -l nmmdg ubuntu
WORKDIR /home/nmmdg/
COPY --from=cargo-build /usr/src/nmmdg/target/release/no_more_mr_dice_guy nmmdg
RUN chown nmmdg:nmmdg nmmdg
USER nmmdg
VOLUME /home/nmmdg/store/
ENV DISCORD_TOKEN=
CMD ["./nmmdg"]