-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (19 loc) · 772 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (19 loc) · 772 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
FROM rust:alpine as builder
ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN apk update && apk add --no-cache openssl-dev musl-dev
WORKDIR /usr/src/binary
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && touch src/lib.rs
RUN cargo build --release
COPY . .
RUN touch src/lib.rs && cargo install --offline --path .
# ---------------------------------------------------------------------------- #
FROM alpine:latest
ENV LARES_HOST="0.0.0.0"
ENV LARES_PORT="4000"
RUN apk update && apk add --no-cache openssl ca-certificates libcurl libgcc
COPY --from=builder /usr/local/cargo/bin/lares /usr/local/bin/lares
COPY --from=builder /usr/src/binary/entrypoint.sh /usr/local/bin/entrypoint.sh
EXPOSE $LARES_PORT/tcp
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["server"]