-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.railway
More file actions
53 lines (39 loc) · 1.05 KB
/
Dockerfile.railway
File metadata and controls
53 lines (39 loc) · 1.05 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
# Gork Agent Relay
FROM rust:1.86 as builder
# Force rebuild
ARG CACHEBUST=1
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y \
clang \
libclang-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy source
COPY . .
# Build relay
RUN cargo build --release --bin gork-agent
# Runtime image
FROM debian:bookworm-slim
# Install dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
wget \
&& rm -rf /var/lib/apt/lists/*
# Copy binary from builder
COPY --from=builder /app/target/release/gork-agent /usr/local/bin/gork-agent
# Copy entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Create non-root user
RUN useradd -m -u 1000 gork && \
mkdir -p /home/gork/.gork-agent && \
chown -R gork:gork /home/gork
USER gork
# Expose ports
# 4001: P2P relay
# 9090: Metrics
EXPOSE 4001 9090
# Set environment
ENV RUST_LOG=info
# Run via entrypoint (initializes if needed, then starts relay)
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]