-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile.worker
More file actions
25 lines (24 loc) · 1.19 KB
/
Copy pathDockerfile.worker
File metadata and controls
25 lines (24 loc) · 1.19 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
FROM golang:1.24-bookworm AS go-build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY cmd cmd
COPY contracts contracts
COPY internal internal
COPY migrations migrations
COPY skills skills
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/contentcloud-worker ./cmd/contentcloud-worker
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates clamav clamav-daemon clamav-freshclam libreoffice-core libreoffice-writer libreoffice-calc libreoffice-impress \
poppler-utils tesseract-ocr tesseract-ocr-chi-sim tesseract-ocr-eng \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --system --uid 10001 --create-home contentcloud \
&& mkdir -p /var/lib/contentcloud /var/log/clamav /var/run/clamav \
&& chown -R contentcloud:contentcloud /var/lib/contentcloud /var/lib/clamav /var/log/clamav /var/run/clamav
COPY --from=go-build /out/contentcloud-worker /usr/local/bin/contentcloud-worker
COPY deploy/worker-entrypoint.sh /usr/local/bin/worker-entrypoint
RUN chmod 0755 /usr/local/bin/worker-entrypoint
USER contentcloud
ENV CONTENTCLOUD_REQUIRE_MALWARE_SCAN=1 CONTENTCLOUD_DATA_DIR=/var/lib/contentcloud
ENTRYPOINT ["worker-entrypoint"]