forked from penumbra-zone/penumbra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (23 loc) · 971 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
27
28
29
30
FROM rust:latest as build
RUN curl https://sh.rustup.rs -sSf | sh -s -- --no-modify-path --default-toolchain none -y
RUN rustup component add rustfmt
RUN apt-get update && apt-get install -y clang libclang-dev
WORKDIR /usr/src
COPY . .
# Fetch dependencies in a separate layer, so that they can be cached.
RUN cargo fetch
RUN cargo build --bin pd --release && \
mkdir -p /out && \
mv target/release/pd /out/pd
# Install the penumbra daemon into the runtime image.
# TODO(eliza): it would be nice to be able to run the Penumbra daemon in a
# `scratch` image rather than Debian or Alpine. However, then we'd have to build
# with a statically linked libc (read: musl), and musl's malloc exhibits
# pathologically poor performance for Tokio applications...
FROM debian:bullseye-slim as runtime
ARG DATABASE_URL
ENV DATABASE_URL=$DATABASE_URL
WORKDIR /penumbra
COPY --from=build /out/pd /usr/bin/pd
ENV RUST_LOG=warn,pd=info,penumbra=info
CMD [ "/usr/bin/pd" ]