-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.api
More file actions
50 lines (35 loc) · 1.14 KB
/
Dockerfile.api
File metadata and controls
50 lines (35 loc) · 1.14 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
# Dockerfile for UET API (Rust Backend)
FROM ubuntu:24.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y curl pkg-config libssl-dev protobuf-compiler build-essential && 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}"
# Copy Cargo workspace files
COPY Cargo.toml Cargo.lock ./
COPY uet_core ./uet_core
COPY uet_kb ./uet_kb
COPY uet_api ./uet_api
COPY uet_miner ./uet_miner
COPY uet_chain ./uet_chain
COPY uet_security ./uet_security
COPY uet_agents ./uet_agents
# Build the API binary
RUN cargo build --release -p uet_api
# Runtime Stage
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app
# Install runtime dependencies
RUN apt-get update && apt-get install -y ca-certificates libssl-dev && rm -rf /var/lib/apt/lists/*
# Copy binary from builder
COPY --from=builder /app/target/release/uet_api /usr/local/bin/uet_api
# Copy migrations
COPY uet_api/migrations ./migrations
# Environment
ENV RUST_LOG=info
# Expose API port
EXPOSE 3001
CMD ["uet_api"]