-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (52 loc) · 1.93 KB
/
Copy pathDockerfile
File metadata and controls
64 lines (52 loc) · 1.93 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
62
63
64
FROM python:3.11-slim-bookworm
ENV FLASK_APP=app
ENV TZ=America/New_York
EXPOSE 5000
# Install all dependencies in one go, then clean up
RUN apt-get update && apt-get install -y --no-install-recommends \
wget \
gnupg \
apt-transport-https \
git \
poppler-utils \
libvips-tools \
tzdata \
rsync \
imagemagick \
ffmpeg \
libreoffice \
xfonts-75dpi \
xfonts-base \
curl \
dpkg-dev \
procps \
&& rm -rf /var/lib/apt/lists/*
# Fix ImageMagick policy
RUN rm /etc/ImageMagick-6/policy.xml
COPY conf/policy.xml /etc/ImageMagick-6/policy.xml
# Add Tesseract repo + install
RUN wget -O - https://notesalexp.org/debian/alexp_key.asc \
| gpg --dearmor -o /usr/share/keyrings/notesalexp-keyring.gpg \
&& echo "deb [signed-by=/usr/share/keyrings/notesalexp-keyring.gpg] https://notesalexp.org/tesseract-ocr5/buster/ buster main" \
> /etc/apt/sources.list.d/tesseract.list \
&& apt-get update && apt-get install -y --no-install-recommends tesseract-ocr \
&& rm -rf /var/lib/apt/lists/*
# Install wkhtmltopdf
RUN curl -L -o /tmp/wkhtmltox.deb \
https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.bookworm_amd64.deb \
&& dpkg -i /tmp/wkhtmltox.deb \
&& rm -f /tmp/wkhtmltox.deb
WORKDIR /code
# Install Python deps before copying code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy configs and app
COPY .archivessnake.yml /root
COPY .iiiflow.yml /root
RUN mkdir -p /root/.description_harvester
COPY .description_harvester/ /root/.description_harvester/
COPY . /code
# Set up description harvester plugins
RUN git clone https://github.com/UAlbanyArchives/description_harvester_plugins.git
RUN chmod +x ./gunicorn.sh
#ENTRYPOINT ["./gunicorn.sh"]