-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
58 lines (45 loc) · 1.43 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
55
56
57
58
# Builder stage
FROM --platform=$BUILDPLATFORM rust:1.83-slim-bullseye AS builder
# Add platform-specific arguments
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETARCH
ARG ENABLE_TDX
# Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
pkg-config \
curl \
libssl-dev \
libssl1.1 \
&& if [ "$ENABLE_TDX" = "true" ]; then \
apt-get install -y libtss2-dev; \
fi \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/atoma-node
COPY . .
# Compile
RUN if [ "$ENABLE_TDX" = "true" ]; then \
RUST_LOG=${TRACE_LEVEL} cargo build --release --bin atoma-node --features tdx; \
else \
RUST_LOG=${TRACE_LEVEL} cargo build --release --bin atoma-node; \
fi
# Final stage
FROM --platform=$TARGETPLATFORM debian:bullseye-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl1.1 \
libsqlite3-0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Create necessary directories
RUN mkdir -p /app/data /app/logs
# Copy the built binary from builder stage
COPY --from=builder /usr/src/atoma-node/target/release/atoma-node /usr/local/bin/atoma-node
RUN chmod +x /usr/local/bin/atoma-node
# Copy and set up entrypoint script
COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/usr/local/bin/atoma-node", "--config-path", "/app/config.toml"]