-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
54 lines (39 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
42
43
44
45
46
47
48
49
50
51
52
53
54
# Stage 1: Build the application
FROM rust:latest AS builder
ARG BUILD_FEATURES
# Update system packages and install build dependencies
RUN apt update -y && \
apt install -y \
cmake \
pkg-config \
libssl-dev \
git \
gcc \
build-essential \
clang \
libclang-dev \
protobuf-compiler \
jq \
ntp \
libpq-dev
RUN rustup target add wasm32-unknown-unknown
RUN rustup component add rustfmt clippy rust-src
WORKDIR /app
# Copy the project files
COPY . .
# Build the application
RUN cargo build --features "$BUILD_FEATURES" --locked --release
# Stage 2: Create the final image
FROM ubuntu:latest
EXPOSE 9944
RUN apt update -y && apt install -y curl
# Set the working directory
WORKDIR /app
# Copy the built binary from the builder stage
COPY --from=builder \
/app/target/release/lib* \
/app/target/release/atleta-node \
/app/target/release/polkadot-execute-worker \
/app/target/release/polkadot-prepare-worker \
/app/bin/
ENTRYPOINT ["/app/bin/atleta-node"]