-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (22 loc) · 754 Bytes
/
Dockerfile
File metadata and controls
36 lines (22 loc) · 754 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
FROM rust:bookworm as builder
ARG EXTRA_FEATURES=""
WORKDIR /open_router
ENV CARGO_NET_RETRY=10
ENV RUSTUP_MAX_RETRIES=10
ENV CARGO_INCREMENTAL=0
RUN apt-get update \
&& apt-get install -y cmake libpq-dev libssl-dev pkg-config protobuf-compiler clang
COPY . .
RUN RUSTFLAGS="-A warnings" cargo build --release --features release ${EXTRA_FEATURES}
FROM debian:bookworm
ARG CONFIG_DIR=/local/config
ARG BIN_DIR=/local
ARG BINARY=open_router
ENV BINARY=${BINARY}
RUN apt-get update \
&& apt-get install -y ca-certificates tzdata libpq-dev curl procps libmariadb-dev
EXPOSE 8080
RUN mkdir -p ${CONFIG_DIR}
COPY --from=builder /open_router/target/release/${BINARY} ${BIN_DIR}/${BINARY}
WORKDIR ${BIN_DIR}
CMD ["sh", "-c", "./${BINARY}"]