-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
26 lines (18 loc) · 662 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
FROM rustlang/rust:nightly-buster-slim AS builder
RUN apt-get update && apt-get -y install cmake && rm -rf /var/lib/apt/lists/*
WORKDIR /work
ADD . .
# E.g. "RUSTFLAGS=-C target-cpu=native" for optimizing build for host CPU.
ARG RUSTFLAGS
RUN cargo install --path dars
FROM debian:stable-20220418-slim
RUN apt-get update && apt-get -y install tini && rm -rf /var/lib/apt/lists/*
WORKDIR /work/
COPY --from=builder /usr/local/cargo/bin/dars /usr/bin/dars
ADD ./entrypoint.sh .
ADD data /data
ENV DARS_PORT=${DARS_PORT:-8001}
EXPOSE ${DARS_PORT}
ENV RUST_LOG=${RUST_LOG:-info}
ENTRYPOINT [ "/usr/bin/tini", "-g", "--", "./entrypoint.sh" ]
CMD [ "/data/" ]