Skip to content

Commit

Permalink
chore: switch to distroless Docker runtime images
Browse files Browse the repository at this point in the history
fix: match Debian releases for build

closes #297

Co-authored-by: MaticPoh <85814976+MaticPoh@users.noreply.github.com>
  • Loading branch information
insertish and MaticPoh committed Aug 30, 2024
1 parent 79e1388 commit 730039e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Stage
FROM --platform="${BUILDPLATFORM}" rust:1.76.0-slim
FROM --platform="${BUILDPLATFORM}" rust:1.80.1-slim-bookworm
USER 0:0
WORKDIR /home/rust/src

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.useCurrentArch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build Stage
FROM rust:1.76.0-slim
FROM rust:1.80.1-slim-bookworm
USER 0:0
WORKDIR /home/rust/src

Expand Down
7 changes: 3 additions & 4 deletions crates/bonfire/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
FROM ghcr.io/revoltchat/base:latest AS builder

# Bundle Stage
FROM debian:bullseye-slim
RUN apt-get update && \
apt-get install -y ca-certificates && \
apt-get clean
FROM gcr.io/distroless/cc-debian12:nonroot
COPY --from=builder /home/rust/src/target/release/revolt-bonfire ./

EXPOSE 9000
USER nonroot
CMD ["./revolt-bonfire"]
2 changes: 2 additions & 0 deletions crates/core/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ static CONFIG_BUILDER: Lazy<RwLock<Config>> = Lazy::new(|| {
));
} else if std::path::Path::new("Revolt.toml").exists() {
builder = builder.add_source(File::new("Revolt.toml", FileFormat::Toml));
} else if std::path::Path::new("/Revolt.toml").exists() {
builder = builder.add_source(File::new("/Revolt.toml", FileFormat::Toml));
}

builder.build().unwrap()
Expand Down
6 changes: 2 additions & 4 deletions crates/delta/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
FROM ghcr.io/revoltchat/base:latest AS builder

# Bundle Stage
FROM debian:bullseye-slim
RUN apt-get update && \
apt-get install -y ca-certificates && \
apt-get clean
FROM gcr.io/distroless/cc-debian12:nonroot
COPY --from=builder /home/rust/src/target/release/revolt-delta ./

EXPOSE 8000
ENV ROCKET_ADDRESS 0.0.0.0
ENV ROCKET_PORT 8000
USER nonroot
CMD ["./revolt-delta"]

0 comments on commit 730039e

Please sign in to comment.