-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (39 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
59 lines (39 loc) · 1.18 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
54
55
56
57
58
# Stage 1: Build UI
FROM node:20-alpine AS ui-builder
WORKDIR /app/ui
# Copy UI package files
COPY ui/package*.json ./
# Install dependencies
RUN npm ci
# Copy UI source
COPY ui/ ./
# Build UI
RUN npm run build
# Stage 2: Build Go binary
FROM golang:1.24.11-trixie AS go-builder
WORKDIR /app
# Copy go mod files first
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
COPY main.go ./
COPY pkg/ ./pkg/
# Build Go binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o xivstrings .
# Stage 3: Final image
FROM gcr.io/distroless/static-debian13
WORKDIR /app
# Copy Go binary from builder
COPY --from=go-builder /app/xivstrings .
# Copy UI dist from builder
COPY --from=ui-builder /app/ui/dist ./ui/dist
# Persistent data: version file, strings/<version>/, index/<version>/
# On first run the server will fetch latest ixion release and populate this.
VOLUME /app/data
# Optional: set to allow POST /api/version?token=... to trigger updates.
# If unset, POST /api/version returns 403.
# ENV XIVSTRINGS_UPDATE_TOKEN=
# Expose port
EXPOSE 8080
# -data /app/data: use volume for version, strings, and index
CMD ["./xivstrings", "-addr", ":8080", "-data", "/app/data"]