-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (27 loc) · 897 Bytes
/
Dockerfile
File metadata and controls
29 lines (27 loc) · 897 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
# Stage 1: Build frontend
FROM oven/bun:1 AS frontend
WORKDIR /app/frontend
COPY frontend/package.json frontend/bun.lockb* ./
RUN bun install --frozen-lockfile
COPY frontend/ ./
RUN bun run build
# Stage 2: Build Go binary
FROM golang:1.25-alpine AS backend
WORKDIR /app
RUN apk add --no-cache git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=frontend /app/frontend/build ./frontend/build
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o kefw2ui .
# Stage 3: Runtime
FROM alpine:latest
RUN apk add --no-cache ca-certificates tzdata
RUN adduser -D -u 1000 kefw2ui
RUN mkdir -p /home/kefw2ui/.config/kefw2 /home/kefw2ui/.cache/kefw2 /data/tailscale && chown -R kefw2ui:kefw2ui /home/kefw2ui /data/tailscale
USER kefw2ui
WORKDIR /home/kefw2ui
COPY --from=backend /app/kefw2ui /usr/local/bin/
EXPOSE 8080
ENTRYPOINT ["kefw2ui"]
CMD ["--bind", "0.0.0.0", "--port", "8080"]