-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (28 loc) · 920 Bytes
/
Dockerfile
File metadata and controls
45 lines (28 loc) · 920 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
34
35
36
37
38
39
40
41
42
43
44
45
FROM golang:1.25 AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-o /bin/playwright-cli github.com/playwright-community/playwright-go/cmd/playwright
FROM ubuntu:jammy AS setup
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /bin/playwright-cli /app/playwright-cli
RUN ./playwright-cli install --with-deps chromium firefox webkit \
&& rm -f /app/playwright-cli
FROM golang:1.25 AS gorimpobuilder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG APP_VERSION=dev
RUN CGO_ENABLED=0 GOOS=linux go build \
-ldflags "-X main.Version=${APP_VERSION}" \
-o /bin/gorimpo ./cmd/gorimpo/main.go
FROM setup AS final
WORKDIR /app
COPY --from=gorimpobuilder /bin/gorimpo /app/gorimpo
CMD ["./gorimpo"]