File tree Expand file tree Collapse file tree 3 files changed +65
-0
lines changed
tools/heartbeats-processor Expand file tree Collapse file tree 3 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 1+ target /
2+ .env
3+ .env. *
4+ data /
5+ * .db
6+ .git /
7+ .gitignore
8+ .dockerignore
9+ README.md
10+ # Ensure .sqlx files are included
11+ ! .sqlx /
Original file line number Diff line number Diff line change 1+ # Build stage
2+ FROM rust:1.84-slim-bookworm AS builder
3+
4+ WORKDIR /usr/src/app
5+ RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
6+
7+ COPY Cargo.toml ./
8+
9+ # Handle deps first to cache them
10+ RUN mkdir src && echo "fn main() {}" > src/main.rs
11+ RUN cargo build --release
12+ RUN rm -f target/release/deps/heartbeats_processor*
13+
14+ # With deps in place, copy code and build
15+ COPY . .
16+ RUN cargo build --release
17+
18+ # Runtime stage
19+ FROM debian:bookworm-slim
20+
21+ RUN apt-get update && apt-get install -y libsqlite3-0 ca-certificates && rm -rf /var/lib/apt/lists/*
22+
23+ WORKDIR /app
24+
25+ COPY --from=builder /usr/src/app/target/release/heartbeats-processor .
26+ COPY schema.sql .
27+
28+ ENV DATABASE_PATH=/app/data/heartbeats.db
29+
30+ ENTRYPOINT ["./heartbeats-processor" ]
31+ CMD ["process-loop" ]
Original file line number Diff line number Diff line change 1+ version : ' 3.8'
2+
3+ services :
4+ heartbeats-processor :
5+ # build: .
6+ image : openmina/heartbeat-processor:local
7+ environment :
8+ - GOOGLE_CLOUD_PROJECT=${GOOGLE_CLOUD_PROJECT:-staging}
9+ - WINDOW_RANGE_START=${WINDOW_RANGE_START:-}
10+ - WINDOW_RANGE_END=${WINDOW_RANGE_END:-}
11+ # - FIRESTORE_EMULATOR_HOST=${FIRESTORE_EMULATOR_HOST:-}
12+ - DISABLED_WINDOWS=${DISABLED_WINDOWS:-}
13+ - GOOGLE_APPLICATION_CREDENTIALS=/credentials/service-account.json
14+ - DATABASE_PATH=${DATABASE_PATH:-/app/data/store.db}
15+ volumes :
16+ - ./data:/app/data
17+ - ./credentials:/credentials:ro
18+ command : ["process-loop", "--interval-seconds", "300"]
19+ restart : unless-stopped
20+
21+ volumes :
22+ data :
23+ driver : local
You can’t perform that action at this time.
0 commit comments