-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (24 loc) · 701 Bytes
/
Dockerfile
File metadata and controls
30 lines (24 loc) · 701 Bytes
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:1.71.0 AS builder
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs
RUN cargo build --release && rm -rf src
COPY src ./src
RUN touch src/main.rs
RUN cargo build --release
FROM debian:bookworm-slim AS runtime
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
libcurl4 \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --create-home --shell /bin/bash app
WORKDIR /app
COPY --from=builder /app/target/release/eth-txs-api /app/eth-txs-api
COPY migrations ./migrations
COPY configs ./configs
RUN chown -R app:app /app
USER app
EXPOSE 8080
ENV RUST_LOG=info
CMD ["./eth-txs-api", "--config", "configs/config.toml"]