mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
39 lines
1.4 KiB
Docker
39 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/docker/library/rust:bookworm as builder
|
|
FROM public.ecr.aws/zinclabs/rust:bookworm-sccache AS builder
|
|
ARG AWS_DEFAULT_REGION
|
|
ARG AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
|
|
|
|
# ENV SCCACHE_BUCKET=codepipeline-us-west-2-scccache
|
|
# ENV SCCACHE_REGION=us-west-2
|
|
# ENV SCCACHE_S3_KEY_PREFIX=zincobserve/dev/amd64/
|
|
# ENV SCCACHE_NO_DAEMON=1
|
|
# ENV SCCACHE_LOG=debug
|
|
|
|
RUN rustc --version && sccache --version
|
|
|
|
WORKDIR /openobserve
|
|
COPY . /openobserve
|
|
COPY --from=webBuilder /web/dist web/dist
|
|
RUN mkdir -p /openobserve/target/release/
|
|
|
|
RUN --mount=type=cache,target=/root/.cache/sccache cargo build --profile release-profiling --features mimalloc,profiling --target x86_64-unknown-linux-gnu \
|
|
&& sccache --show-stats
|
|
RUN mv /openobserve/target/x86_64-unknown-linux-gnu/release-profiling/openobserve /openobserve/target/release/openobserve
|
|
|
|
# FROM gcr.io/distroless/cc as runtime
|
|
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 sysstat procps lsof net-tools sqlite3
|
|
RUN update-ca-certificates
|
|
COPY --from=builder /openobserve/target/release/openobserve /
|
|
RUN ["/openobserve", "init-dir", "-p", "/data/"]
|
|
CMD ["/openobserve"]
|