forked from Extravi/araa-search
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
73 lines (59 loc) · 1.79 KB
/
Dockerfile
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
FROM python:3.12.4-alpine AS builder
ARG TARGETARCH
# Container metadata.
LABEL title="Araa Search" \
description="A privacy-respecting, ad-free, self-hosted Google metasearch engine with strong security and full API support." \
git_repo="https://github.com/TEMtheLEM/araa-search" \
authors="https://github.com/Extravi/araa-search/contributors" \
maintainer="TEMtheLEM <[email protected]>" \
image="https://hub.docker.com/r/temthelem/araa-search"
WORKDIR /build
# Packages needed to build lxml on 32-bit platforms.
# Not required for 64-bit.
RUN if ! [[ $TARGETARCH = *64* ]]; then \
apk add --update --no-cache --virtual .build_deps \
pkgconf \
zlib-dev \
xz \
xz-dev \
libxml2 \
libxml2-utils \
libxml2-dev \
libgpg-error \
libgcrypt \
libxslt \
libxslt-dev \
libgcc \
jansson \
libstdc++ \
zstd-libs \
binutils \
libgomp \
libatomic \
gmp \
isl26 \
mpfr4 \
mpc1 \
gcc \
musl-dev; \
fi
COPY requirements.txt .
# We will only be running our own python app in a container,
# so this shouldn't be terrible.
RUN pip3 install --break-system-packages -r requirements.txt
# Stash build, take only what's needed.
FROM python:3.12.4-alpine AS deployment
ARG TARGETARCH
# Both of these packages are needed for lxml to work on 32-bit platforms.
# Package installation can be skipped on 64-bit platforms.
RUN if ! [[ $TARGETARCH = *64* ]]; then \
apk add --update --no-cache \
libxml2 \
libxslt; \
fi
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=builder /usr/local/bin/gunicorn /usr/local/bin/gunicorn
WORKDIR /app
COPY . .
ENV ORIGIN_REPO=https://github.com/TEMtheLEM/araa-search
CMD [ "sh", "scripts/docker-cmd.sh" ]