forked from Txio-labs/txio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (29 loc) · 1.2 KB
/
Copy pathDockerfile
File metadata and controls
42 lines (29 loc) · 1.2 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
# Build stage
FROM rust:1.88.0-slim-bookworm AS builder
# Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the full Rust workspace so Cargo can resolve all workspace members.
# This avoids missing-path issues when workspace members have deeper path dependencies.
COPY Cargo.toml Cargo.lock ./
COPY backend ./backend
COPY cli ./cli
# Build both backend and cli from the workspace root.
RUN cargo build --release --package txio-api --package txio
# Runtime stage
FROM debian:bookworm-slim
WORKDIR /app
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates libssl3 && rm -rf /var/lib/apt/lists/*
# Copy backend binary
COPY --from=builder /app/target/release/txio-api /app/api
# Copy CLI binary to system PATH so TerminalService can find it
COPY --from=builder /app/target/release/txio /usr/local/bin/txio
# Create a temporary directory for cargo operations if needed
RUN mkdir -p /app/temp
# Set environment variables
ENV RUST_LOG=info
ENV MONGO_URI=mongodb://mongodb:27017/txio
EXPOSE 8000
# The entrypoint is the backend API
CMD ["./api"]