-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.arm64
81 lines (61 loc) · 1.9 KB
/
Dockerfile.arm64
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
### Frontend build
FROM node:18.17-alpine3.17 as frontend
RUN apk update
RUN apk --no-cache add \
git \
make \
gcc \
g++ \
musl-dev \
nodejs \
npm
RUN yarn add react-scripts
WORKDIR /virtualpaper
COPY . /virtualpaper
RUN yarn config set network-timeout 600000 -g
RUN cd frontend; yarn install
RUN make build-frontend
# Backend build
FROM golang:1.20-alpine3.17 as backend
RUN apk update
RUN apk --no-cache add \
git \
make \
gcc \
g++ \
musl-dev
WORKDIR /virtualpaper
COPY . /virtualpaper
COPY --from=frontend /virtualpaper/frontend/build /virtualpaper/frontend/build
RUN go mod download
RUN make build
# Runtime
FROM alpine:3.18.3
RUN apk add \
tesseract-ocr \
imagemagick \
imagemagick-dev \
poppler-utils
RUN wget https://github.com/jgm/pandoc/releases/download/2.18/pandoc-2.18-linux-arm64.tar.gz
RUN tar -xvf pandoc-2.18-linux-arm64.tar.gz
RUN rm pandoc-2.18-linux-arm64.tar.gz
RUN addgroup -S -g 1000 virtualpaper && \
adduser -S -H -D -h /data -u 1000 -G virtualpaper virtualpaper
VOLUME ["/data"]
VOLUME ["/config"]
VOLUME ["/input"]
VOLUME ["/usr/share/tessdata/"]
COPY --from=backend /virtualpaper/virtualpaper /app/virtualpaper
COPY --from=backend /virtualpaper/config.sample.toml /config/config.toml
COPY --from=backend /virtualpaper/docker/imagemagick-7-policy.xml /etc/ImageMagick-7/policy.xml
COPY --from=backend /virtualpaper/docker/start.sh /app/start.sh
ENV VIRTUALPAPER_API_STATIC_CONTENT_PATH="/app/frontend"
ENV VIRTUALPAPER_PROCESSING_DATA_DIR="/data"
ENV VIRTUALPAPER_PROCESSING_INPUT_DIR="/input"
ENV VIRTUALPAPER_LOGGING_DIRECTORY="/log"
ENV VIRTUALPAPER_PROCESSING_PANDOC_BIN="/pandoc-2.18/bin/pandoc"
ENV VIRTUALPAPER_PROCESSING_PDFTOTEXT_BIN="/usr/bin/pdftotext"
ENV VIRTUALPAPER_PROCESSING_IMAGICK_BIN="/usr/bin/convert"
ENV VIRTUALPAPER_PROCESSING_TESSERACT_BIN="/usr/bin/tesseract"
EXPOSE 8000:8000
ENTRYPOINT ["app/start.sh"]