-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 1002 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 1002 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
ARG GO_BUILDER=docker.io/library/golang:1.24
ARG BASE_IMAGE=docker.io/library/alpine:3.12
ARG UI_BUILDER=docker.io/library/node:22-alpine3.21
FROM ${UI_BUILDER} AS builder_ui
WORKDIR /workspace
COPY ui ui
RUN cd ui && npm install && npm run build-only
FROM ${GO_BUILDER} AS builder
ARG VERSION
ARG GOPROXY
WORKDIR /workspace
COPY --from=builder_ui /workspace/ui/dist /workspace/ui/dist
COPY . .
RUN GOPROXY=${GOPROXY} go mod download
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s -X github.com/linuxsuren/api-testing/pkg/version.version=${VERSION}\
-X github.com/linuxsuren/api-testing/pkg/version.date=$(date +%Y-%m-%d)" -o atest-store-database .
FROM ${BASE_IMAGE}
LABEL org.opencontainers.image.source=https://github.com/linuxsuren/atest-ext-store-database
LABEL org.opencontainers.image.description="ORM database Store Extension of the API Testing."
COPY --from=builder /workspace/atest-store-database /usr/local/bin/atest-store-database
CMD [ "atest-store-database" ]