-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (39 loc) · 1.03 KB
/
Dockerfile
File metadata and controls
53 lines (39 loc) · 1.03 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
# Multi-stage build for Ryzan Wallet
FROM rust:latest as builder
# Install required dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy manifests first for better caching
COPY Cargo.toml Cargo.lock ./
# Copy source code
COPY src ./src
# Build the application
RUN cargo build --release && \
strip target/release/ryzan
# Runtime stage
FROM debian:bookworm-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -m -u 1001 ryzan
# Copy binary from builder
COPY --from=builder /app/target/release/ryzan /usr/local/bin/ryzan
# Set permissions
RUN chmod +x /usr/local/bin/ryzan
# Switch to non-root user
USER ryzan
WORKDIR /home/ryzan
# Create config directory
RUN mkdir -p .config/ryzan
# Expose no ports (CLI application)
# Set environment
ENV RUST_LOG=info
# Default command
ENTRYPOINT ["ryzan"]
CMD ["--help"]