-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Expand file tree
/
Copy pathDockerfile.relay
More file actions
50 lines (40 loc) · 2.26 KB
/
Dockerfile.relay
File metadata and controls
50 lines (40 loc) · 2.26 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
# =============================================================================
# AIS Relay Sidecar
# =============================================================================
# Runs scripts/ais-relay.cjs as a standalone container.
# Dependencies: ws (WebSocket), telegram (OSINT polling), plus others in
# scripts/package.json (fast-xml-parser, @anthropic-ai/sdk, etc.)
# Set AISSTREAM_API_KEY in docker-compose.yml or Railway env.
# =============================================================================
FROM node:22-alpine
# curl required by OREF polling (Node.js JA3 fingerprint blocked by Akamai; curl passes)
RUN apk add --no-cache curl
WORKDIR /app
# Install scripts/ runtime dependencies (telegram, ws, fast-xml-parser, etc.)
COPY scripts/package.json scripts/package-lock.json ./scripts/
RUN npm ci --prefix scripts --omit=dev
# Relay script and shared helpers
COPY scripts/ais-relay.cjs ./scripts/ais-relay.cjs
COPY scripts/_proxy-utils.cjs ./scripts/_proxy-utils.cjs
COPY scripts/_seed-utils.mjs ./scripts/_seed-utils.mjs
# _seed-envelope-source.mjs and _seed-contract.mjs are transitively imported
# by _seed-utils.mjs (lines 9-10) and by seed-chokepoint-flows.mjs /
# seed-ember-electricity.mjs directly. Missing them here = silent
# ERR_MODULE_NOT_FOUND on every execFile invocation, which looks like a hung
# Railway cron (the initial-seed path throws, the 6h setInterval keeps firing
# but each child dies on import). tests/dockerfile-relay-imports.test.mjs
# guards this COPY list against future regressions.
COPY scripts/_seed-envelope-source.mjs ./scripts/_seed-envelope-source.mjs
COPY scripts/_seed-contract.mjs ./scripts/_seed-contract.mjs
COPY scripts/_country-resolver.mjs ./scripts/_country-resolver.mjs
COPY scripts/seed-climate-news.mjs ./scripts/seed-climate-news.mjs
COPY scripts/seed-chokepoint-flows.mjs ./scripts/seed-chokepoint-flows.mjs
COPY scripts/seed-ember-electricity.mjs ./scripts/seed-ember-electricity.mjs
# Shared helper required by the relay (rss-allowed-domains.cjs)
COPY shared/ ./shared/
# Data files required by the relay (telegram-channels.json, etc.)
COPY data/ ./data/
EXPOSE 3004
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://localhost:3004/health || exit 1
CMD ["node", "scripts/ais-relay.cjs"]