-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (23 loc) · 726 Bytes
/
Dockerfile
File metadata and controls
41 lines (23 loc) · 726 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
FROM node:22.20.0-alpine AS frontend-builder
WORKDIR /app/frontend
COPY app/package*.json ./
RUN npm install
COPY app/ ./
RUN npm run build
FROM golang:1.25.0-alpine AS go-builder
WORKDIR /app
RUN apk add --no-cache git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=frontend-builder /app/frontend/dist ./app/dist
RUN CGO_ENABLED=0 GOOS=linux go build -o server cmd/server/main.go
FROM alpine:latest
WORKDIR /app
RUN apk add --no-cache ca-certificates git
COPY --from=go-builder /app/server .
ENV PORT=8080
EXPOSE ${PORT}
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:${PORT}/ || exit 1
CMD ["./server"]