-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
41 lines (31 loc) · 1.01 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
ARG RUSTUP_TOOLCHAIN=stable
FROM --platform=${BUILDPLATFORM:-linux/amd64} ghcr.io/topos-protocol/rust_builder:bullseye-${RUSTUP_TOOLCHAIN} AS base
ARG FEATURES
# Rust cache
ARG SCCACHE_S3_KEY_PREFIX
ARG SCCACHE_BUCKET
ARG SCCACHE_REGION
ARG RUSTC_WRAPPER
ARG PROTOC_VERSION=22.2
WORKDIR /usr/src/app
FROM --platform=${BUILDPLATFORM:-linux/amd64} base AS build
COPY . .
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
--mount=type=cache,id=sccache,target=/root/.cache/sccache \
cargo build --release --no-default-features --features=${FEATURES} \
&& sccache --show-stats
FROM --platform=${BUILDPLATFORM:-linux/amd64} debian:bullseye-slim AS topos
ENV TCE_PORT=9090
ENV USER=topos
ENV UID=10001
ENV PATH="${PATH}:/usr/src/app"
WORKDIR /usr/src/app
COPY --from=build /usr/src/app/target/release/topos .
RUN apt-get update && apt-get install -y \
ca-certificates \
jq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /tmp/node_config
RUN mkdir /tmp/shared
ENTRYPOINT ["./topos"]