-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (48 loc) · 1.69 KB
/
Dockerfile
File metadata and controls
62 lines (48 loc) · 1.69 KB
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
59
60
61
62
# Base stage: Install Rust and dependencies
FROM ubuntu:24.04 AS builder
WORKDIR /usr/src/app
# Install required dependencies
RUN apt-get update && apt-get install -y \
curl \
clang \
build-essential \
git \
pkg-config \
libssl-dev \
protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH=/root/.cargo/bin:$PATH
RUN rustup install stable && rustup default stable
# Install Go
RUN apt update
RUN apt install -y golang-go
# Install SP1
RUN curl -L https://sp1.succinct.xyz | bash && \
~/.sp1/bin/sp1up && \
~/.sp1/bin/cargo-prove prove --version
# Copy the entire workspace
COPY . .
# Build the proposer binary
RUN cargo build --release --bin pylon-tg-bot --locked
###############################################################################
# #
# Runtime #
# #
###############################################################################
FROM ubuntu:24.04 as runtime
WORKDIR /app
# Install only necessary runtime dependencies
RUN apt-get update && apt-get install -y \
curl \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH=/root/.cargo/bin:$PATH
RUN rustup install stable && rustup default stable
# Copy the built proposer binary
COPY --from=builder /usr/src/app/target/release/pylon-tg-bot /usr/local/bin/
# Set the command
CMD ["pylon-tg-bot"]