-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (25 loc) · 789 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (25 loc) · 789 Bytes
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
# Build a static Harpy node binary, then ship it on bare Alpine.
# Used by docker-compose.testnet.yml for the staging testnet (MIC-74).
FROM crystallang/crystal:1.20-alpine AS build
WORKDIR /app
RUN apk add --no-cache gmp-static
COPY shard.yml shard.lock ./
RUN shards install --production
COPY src ./src
RUN shards build harpy --release --static --no-debug
FROM alpine:3.21
RUN apk add --no-cache curl \
&& adduser -D -H harpy \
&& mkdir -p /data \
&& chown harpy:harpy /data
WORKDIR /app
COPY --from=build /app/bin/harpy /usr/local/bin/harpy
COPY public ./public
ENV HARPY_DATA_DIR=/data
VOLUME ["/data"]
USER harpy
# HTTP API / P2P gossip
EXPOSE 3000 9333
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD curl -fsS http://127.0.0.1:3000/health || exit 1
CMD ["harpy"]