forked from paritytech/jamtart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (35 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
50 lines (35 loc) · 1.07 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
# Build stage - use Debian-based nightly for glibc compatibility
FROM rust:bookworm AS builder
# Use stable toolchain (aligned with CI)
RUN rustup default stable
WORKDIR /app
# Copy manifests
COPY Cargo.toml Cargo.lock ./
# Copy migrations for sqlx compile-time verification
COPY migrations ./migrations
# Copy source code
COPY src ./src
# Build for release
RUN cargo build --release
# Runtime stage
FROM debian:bookworm-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
libpq5 \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the binary from builder
COPY --from=builder /app/target/release/tart-backend /app/tart-backend
# Create data directory
RUN mkdir -p /data
# Expose ports
EXPOSE 9000 8080
# Set default bind addresses (non-sensitive defaults)
ENV TELEMETRY_BIND=0.0.0.0:9000
ENV API_BIND=0.0.0.0:8080
# DATABASE_URL must be provided at runtime via environment variable or docker-compose
# Example: DATABASE_URL=postgres://user:password@host:5432/dbname
# Run the binary
CMD ["/app/tart-backend"]