-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 965 Bytes
/
Dockerfile
File metadata and controls
37 lines (24 loc) · 965 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
27
28
29
30
31
32
33
34
35
36
37
# === Stage 1: Build React Panel ===
FROM node:18-alpine AS panel-builder
WORKDIR /panel
COPY HORNETS-Relay-Panel/package.json HORNETS-Relay-Panel/yarn.lock ./
RUN yarn install --frozen-lockfile
COPY HORNETS-Relay-Panel/ ./
RUN yarn build
# === Stage 2: Build Go Relay ===
FROM golang:1.23-alpine AS relay-builder
WORKDIR /app
RUN apk add --no-cache git gcc musl-dev
COPY HORNETS-Nostr-Relay/go.mod HORNETS-Nostr-Relay/go.sum ./
RUN go mod download
COPY HORNETS-Nostr-Relay/ ./
RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o relay ./services/server/port
# === Stage 3: Final Minimal Runtime Image ===
FROM alpine:latest
RUN addgroup -S appgroup && adduser -S appuser -G appgroup && apk add --no-cache ca-certificates chromium
WORKDIR /app
COPY --from=relay-builder /app/relay ./
COPY --from=panel-builder /panel/build ./web
RUN mkdir -p /app/data /app/temp /app/statistics && chown -R appuser:appgroup /app
USER appuser
CMD ["./relay"]