-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (28 loc) · 775 Bytes
/
Copy pathDockerfile
File metadata and controls
44 lines (28 loc) · 775 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
38
39
40
41
42
43
44
### Frontend builder ###
FROM node:20-alpine AS web-builder
WORKDIR /app/web
# Install deps separately for better cache hit
COPY web/package.json web/package-lock.json ./
RUN npm install
# Copy full source & build
COPY web/ ./
RUN npm run build
### Backend builder ###
FROM golang:1.24-alpine AS go-builder
WORKDIR /app
# Copy go.mod first for caching
COPY go.mod go.sum ./
RUN go mod download
# Copy entire backend codebase
COPY . ./
# Copy built frontend into backend (e.g., for embedding or serving)
COPY --from=web-builder /app/web/dist ./web/dist
# Build the Go binary
RUN go build -o koala ./cmd/koala
### Final runtime image ###
FROM alpine:latest
WORKDIR /app
# Copy built binary
COPY --from=go-builder /app/koala .
EXPOSE 8000
ENTRYPOINT ["./koala"]