-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (23 loc) 路 736 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (23 loc) 路 736 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
ARG VERSION=1.25
# Build Stage
FROM golang:${VERSION}-alpine AS builder
# hadolint ignore=DL3018
RUN apk --no-cache add ca-certificates dumb-init make git gcc libtool musl-dev nodejs npm \
&& npm install -g pnpm@10.19.0
WORKDIR /app
# Copy the source code
COPY ./ ./
# build backend and frontend
RUN pnpm -C web install && pnpm -C web build \
&& go mod download && go mod tidy
WORKDIR /app/cmd/gowasp
# Build the binary
RUN CGO_ENABLED=1 GOOS=linux go build -ldflags="-w -s" -o /gowasp
# Final Stage
FROM alpine:3
# hadolint ignore=DL3018
RUN apk --no-cache add ca-certificates dumb-init
# Copy the binary from builder stage
COPY --from=builder /gowasp /usr/local/bin/gowasp
# Run
ENTRYPOINT ["/usr/local/bin/gowasp"]