-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (25 loc) · 882 Bytes
/
Dockerfile
File metadata and controls
40 lines (25 loc) · 882 Bytes
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
# syntax=docker/dockerfile:1
FROM rust:1.89-bookworm AS builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY rust-toolchain.toml Cargo.toml Cargo.lock ./
COPY db ./db
COPY storemy-codec-derive ./storemy-codec-derive
RUN cargo build -p storemy --release --locked --bins
FROM debian:bookworm-slim AS runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -g 1000 storemy \
&& useradd -r -u 1000 -g storemy storemy
WORKDIR /app
COPY --from=builder /build/target/release/storemy /build/target/release/metrics_exporter ./
RUN mkdir -p /app/data \
&& chown -R storemy:storemy /app
USER storemy
VOLUME ["/app/data"]
ENV DATA_DIR=/app/data
ENTRYPOINT ["./storemy"]
CMD ["repl"]