/
Dockerfile-dev
33 lines (27 loc) · 897 Bytes
/
Dockerfile-dev
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
FROM rust:1.70.0-slim as builder
RUN apt-get update
RUN apt-get -y install libssl-dev pkg-config
RUN cargo new --bin nun-db
WORKDIR ./nun-db
COPY ./Cargo.toml ./Cargo.toml
RUN mkdir benches/
RUN mkdir src/lib/
RUN mkdir src/bin/
RUN touch benches/nundb_benchmark.rs
RUN touch src/lib/lib.rs
RUN mv src/main.rs src/bin/main.rs
RUN cargo build --release
RUN rm src/**/*.rs
RUN rm benches/*.rs
ADD . ./
RUN touch src/bin/main.rs
RUN touch src/lib/lib.rs
RUN cargo build --release
FROM bitnami/minideb:bullseye
RUN apt-get update
RUN apt-get -y install libssl-dev pkg-config
COPY --from=builder ./nun-db/target/release/nun-db /usr/bin/nun-db
ENV NUN_WS_ADDR "0.0.0.0:3012"
ENV NUN_HTTP_ADDR "0.0.0.0:3013"
ENV NUN_TCP_ADDR "0.0.0.0:3014"
CMD ["sh" , "-c", "nun-db -u ${NUN_USER} -p ${NUN_PWD} start --http-address ${NUN_HTTP_ADDR} --tcp-address ${NUN_TCP_ADDR} --ws-address ${NUN_WS_ADDR} "]