2023-10-19 17:36:44 +08:00
|
|
|
FROM docker.io/library/node:20-alpine3.17 AS ui
|
2023-09-26 07:29:10 +08:00
|
|
|
|
|
|
|
WORKDIR /workspace
|
|
|
|
COPY console/atest-ui .
|
|
|
|
RUN npm install --ignore-scripts --registry=https://registry.npmmirror.com
|
|
|
|
RUN npm run build-only
|
|
|
|
|
2024-08-09 14:28:10 +08:00
|
|
|
FROM docker.io/golang:1.22.4 AS builder
|
2022-06-08 17:32:17 +08:00
|
|
|
|
2023-07-21 18:47:11 +08:00
|
|
|
ARG VERSION
|
2023-07-10 17:03:55 +08:00
|
|
|
ARG GOPROXY
|
2022-06-08 17:32:17 +08:00
|
|
|
WORKDIR /workspace
|
2024-11-11 11:42:53 +08:00
|
|
|
RUN mkdir -p console/atest-ui
|
|
|
|
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY cmd/ cmd/
|
|
|
|
COPY pkg/ pkg/
|
2023-08-10 08:15:53 +08:00
|
|
|
COPY operator/ operator/
|
2023-10-25 15:15:19 +08:00
|
|
|
COPY .github/ .github/
|
2023-11-26 13:44:17 +08:00
|
|
|
COPY sample/ sample/
|
2023-07-16 21:10:03 +08:00
|
|
|
COPY docs/ docs/
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY go.mod go.mod
|
|
|
|
COPY go.sum go.sum
|
2023-06-08 17:27:40 +08:00
|
|
|
COPY go.work go.work
|
|
|
|
COPY go.work.sum go.work.sum
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY main.go main.go
|
2024-11-11 11:42:53 +08:00
|
|
|
COPY console/atest-ui/ui.go console/atest-ui/ui.go
|
|
|
|
COPY console/atest-ui/package.json console/atest-ui/package.json
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY README.md README.md
|
|
|
|
COPY LICENSE LICENSE
|
|
|
|
|
2023-09-26 07:29:10 +08:00
|
|
|
COPY --from=ui /workspace/dist/index.html cmd/data/index.html
|
|
|
|
COPY --from=ui /workspace/dist/assets/*.js cmd/data/index.js
|
|
|
|
COPY --from=ui /workspace/dist/assets/*.css cmd/data/index.css
|
|
|
|
|
2023-11-29 10:32:15 +08:00
|
|
|
# RUN go mod download
|
|
|
|
RUN CGO_ENABLED=0 go build -v -a -ldflags "-w -s -X github.com/linuxsuren/api-testing/pkg/version.version=${VERSION}\
|
2023-11-14 17:10:30 +08:00
|
|
|
-X github.com/linuxsuren/api-testing/pkg/version.date=$(date +%Y-%m-%d)" -o atest .
|
2022-06-08 17:32:17 +08:00
|
|
|
|
2024-03-13 13:36:41 +08:00
|
|
|
FROM docker.io/library/ubuntu:23.10
|
2022-06-08 17:32:17 +08:00
|
|
|
|
|
|
|
LABEL "com.github.actions.name"="API testing"
|
|
|
|
LABEL "com.github.actions.description"="API testing"
|
|
|
|
LABEL "com.github.actions.icon"="home"
|
|
|
|
LABEL "com.github.actions.color"="red"
|
2024-05-09 16:32:00 +08:00
|
|
|
LABEL org.opencontainers.image.description "This is an API testing tool that supports HTTP, gRPC, and GraphQL."
|
2022-06-08 17:32:17 +08:00
|
|
|
|
|
|
|
LABEL "repository"="https://github.com/linuxsuren/api-testing"
|
|
|
|
LABEL "homepage"="https://github.com/linuxsuren/api-testing"
|
|
|
|
LABEL "maintainer"="Rick <linuxsuren@gmail.com>"
|
|
|
|
|
|
|
|
LABEL "Name"="API testing"
|
|
|
|
|
2023-04-04 14:13:16 +08:00
|
|
|
COPY --from=builder /workspace/atest /usr/local/bin/atest
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY --from=builder /workspace/LICENSE /LICENSE
|
|
|
|
COPY --from=builder /workspace/README.md /README.md
|
2022-06-08 17:32:17 +08:00
|
|
|
|
2023-08-15 17:00:31 +08:00
|
|
|
RUN apt update -y && \
|
|
|
|
# required for atest-store-git
|
2024-06-04 10:30:38 +08:00
|
|
|
apt install -y --no-install-recommends ssh-client ca-certificates curl && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2023-08-15 17:00:31 +08:00
|
|
|
|
2024-01-15 13:32:11 +08:00
|
|
|
EXPOSE 8080
|
2023-11-26 13:44:17 +08:00
|
|
|
CMD ["atest", "server", "--local-storage=/var/data/api-testing/*.yaml"]
|