Files
openobserve/deploy/build/Dockerfile.tag-debug.amd64
T

36 lines
1.4 KiB
Docker

# syntax=docker/dockerfile:1
FROM public.ecr.aws/docker/library/node:18.20.4-bookworm AS webBuilder
WORKDIR /web
COPY ./web /web/
RUN npm install
RUN NODE_OPTIONS="--max-old-space-size=8192" npm run build
FROM public.ecr.aws/zinclabs/rust:bookworm-sccache AS builder
# RUN apt-get update
# RUN apt-get install -y protobuf-compiler
# RUN apt-get install -y cmake curl
# RUN rustup toolchain install nightly-2025-03-02
# RUN rustup default nightly-2025-03-02
# RUN rustup target add x86_64-unknown-linux-gnu
WORKDIR /openobserve
COPY . /openobserve
COPY --from=webBuilder /web/dist web/dist
RUN mkdir -p /openobserve/target/release/
# RUN cargo build --release
RUN cargo build --profile release-prod --features mimalloc --target x86_64-unknown-linux-gnu
RUN mv /openobserve/target/x86_64-unknown-linux-gnu/release-prod/openobserve /openobserve/target/release/openobserve
FROM public.ecr.aws/debian/debian:bookworm-slim AS runtime
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
RUN apt-get install -y curl htop iftop nload iptraf ncdu tcpdump sysstat procps lsof net-tools sqlite3
RUN update-ca-certificates
COPY --from=builder /openobserve/target/release/openobserve /
COPY --from=builder /lib/x86_64-linux-gnu/liblzma.so.5 /lib/x86_64-linux-gnu/liblzma.so.5
COPY --from=builder /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1
RUN ["/openobserve", "init-dir", "-p", "/data/"]
CMD ["/openobserve"]