-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.allure3
More file actions
56 lines (42 loc) · 1.92 KB
/
Dockerfile.allure3
File metadata and controls
56 lines (42 loc) · 1.92 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# syntax=docker/dockerfile:1.7
ARG GO_VERSION=1.24.0
ARG ALLURE3_VERSION=3.3.1
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bookworm AS builder
ARG TARGETOS
ARG TARGETARCH
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY cmd ./cmd
COPY internal ./internal
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} \
go build -trimpath -ldflags='-s -w' -o /out/testimony ./cmd/testimony
FROM node:22-bookworm-slim AS runtime
ARG ALLURE3_VERSION
ARG APP_UID=10001
ARG APP_GID=10001
LABEL org.opencontainers.image.title="testimony" \
org.opencontainers.image.description="Testimony server with the Allure 3 + Node runtime" \
org.opencontainers.image.vendor="testimony-dev" \
org.opencontainers.image.source="https://github.com/testimony-dev/testimony"
ENV TESTIMONY_SERVER_HOST=0.0.0.0 \
TESTIMONY_SERVER_PORT=8080 \
TESTIMONY_SQLITE_PATH=/var/lib/testimony/data/testimony.sqlite \
TESTIMONY_TEMP_DIR=/var/lib/testimony/tmp \
TESTIMONY_GENERATE_VARIANT=allure3 \
TESTIMONY_GENERATE_CLI_PATH=/usr/local/bin/allure
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl tini \
&& rm -rf /var/lib/apt/lists/* \
&& npm install --global "allure@${ALLURE3_VERSION}" \
&& npm cache clean --force
RUN groupadd --gid "${APP_GID}" testimony \
&& useradd --uid "${APP_UID}" --gid testimony --create-home --home-dir /home/testimony --shell /usr/sbin/nologin testimony \
&& install -d -o testimony -g testimony /var/lib/testimony/data /var/lib/testimony/tmp
COPY --from=builder /out/testimony /usr/local/bin/testimony
USER testimony:testimony
WORKDIR /var/lib/testimony
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD ["/bin/sh", "-c", "curl --fail --silent http://127.0.0.1:${TESTIMONY_SERVER_PORT}/healthz >/dev/null || exit 1"]
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/testimony"]