-
Notifications
You must be signed in to change notification settings - Fork 217
/
Dockerfile
55 lines (38 loc) · 1.06 KB
/
Dockerfile
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
# syntax=docker/dockerfile:1
# Build Stage ==================================================================
FROM golang:1.23-alpine AS build
RUN apk --no-cache add git
WORKDIR /app
COPY ./go.mod ./go.sum ./
RUN go mod download
COPY . .
RUN go build -o gotestwaf \
-ldflags "-X github.com/wallarm/gotestwaf/internal/version.Version=$(git describe --tags)" \
./cmd/gotestwaf
# Main Stage ===================================================================
FROM alpine
# Prepare environment
RUN <<EOF
set -e -o pipefail
# install all dependencies
apk add --no-cache \
tini \
chromium \
font-inter \
fontconfig
fc-cache -fv
# add non-root user
addgroup gtw
adduser -D -G gtw gtw
# create dir for application
mkdir /app
mkdir /app/reports
chown -R gtw:gtw /app
EOF
WORKDIR /app
COPY --from=build /app/gotestwaf ./
COPY ./testcases ./testcases
COPY ./config.yaml ./
USER gtw
VOLUME [ "/app/reports" ]
ENTRYPOINT [ "/sbin/tini", "--", "/app/gotestwaf" ]