-
-
Notifications
You must be signed in to change notification settings - Fork 617
Expand file tree
/
Copy pathDockerfile.saas
More file actions
61 lines (49 loc) · 1.55 KB
/
Dockerfile.saas
File metadata and controls
61 lines (49 loc) · 1.55 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
57
58
59
60
61
# Build stage
FROM golang:1.26.2-alpine AS builder
WORKDIR /app
# Install build dependencies
RUN apk add --no-cache git ca-certificates
# Copy go mod files
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build the gmapssaas binary (stripped and optimized)
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /gmapssaas ./cmd/gmapssaas
# Final stage - Debian slim with Playwright Chromium dependencies
FROM debian:bookworm-slim
LABEL org.opencontainers.image.source=https://github.com/gosom/google-maps-scraper
WORKDIR /app
# Install Playwright dependencies for Chromium only + cleanup in same layer
# These are the system libraries that Playwright's Chromium needs to run
# The browser itself is downloaded at runtime by playwright-go
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
libnss3 \
libnspr4 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libdbus-1-3 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libasound2 \
libpango-1.0-0 \
libcairo2 \
fonts-liberation \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
&& rm -rf /usr/share/doc /usr/share/man /usr/share/locale
# Copy binary from builder
COPY --from=builder /gmapssaas /app/gmapssaas
# Copy migrations (needed for server mode)
COPY --from=builder /app/migrations /app/migrations
EXPOSE 8080
# Default to serve mode, can be overridden with "worker" argument
ENTRYPOINT ["/app/gmapssaas"]
CMD ["serve"]