-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (30 loc) · 744 Bytes
/
Dockerfile
File metadata and controls
36 lines (30 loc) · 744 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
# syntax=docker/dockerfile:1
##
## Build frontend
##
FROM docker.io/library/node:25-alpine AS npm-build
WORKDIR /npm-build
COPY web/ web/
RUN cd web/ && npm install && npm run build
##
## Build backend
##
FROM docker.io/library/golang:1.25.3-alpine AS go-build
WORKDIR /go-build
COPY go.mod go.sum ./
RUN go mod download
COPY main.go ./
COPY api/ api/
COPY server/ server/
# Copy built frontend folder from frontend build stage
COPY --from=npm-build /npm-build/web/dist server/web
RUN CGO_ENABLED=0 GOOS=linux go build --ldflags '-extldflags "-static"' -o home .
##
## Build runnable container
##
FROM scratch
WORKDIR /app
# Copy built binary from backend build stage
COPY --from=go-build /go-build/home .
EXPOSE 8080
CMD ["/app/home"]