-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (28 loc) · 1.38 KB
/
Copy pathDockerfile
File metadata and controls
32 lines (28 loc) · 1.38 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
FROM alpine:3.21 AS locales
RUN apk add --no-cache py3-babel
COPY locales locales
RUN pybabel compile -d locales
FROM alpine:3.21 AS domains
ADD https://raw.githubusercontent.com/rimu/no-qanon/master/domains.txt .
ADD https://raw.githubusercontent.com/quenhus/uBlock-Origin-dev-filter/main/dist/other_format/domains/global.txt .
RUN cat domains.txt global.txt | grep -v \# | sort -u > domains.txt
FROM alpine:3.21 AS searxng
RUN apk add --no-cache py3-pyaml py3-setuptools patch
ADD https://github.com/searxng/searxng.git#6b1516d6adc88f17e06fe115c3aff69bfcad4579 .
RUN --mount=source=searxng.patch,dst=searxng.patch patch -p1 < searxng.patch
RUN python setup.py bdist_wheel
FROM alpine:3.21 AS scss
RUN apk add --no-cache sassc
COPY scss scss
RUN sassc -t compressed scss/style.scss style.css
FROM python:3-alpine3.21
RUN --mount=type=cache,target=/root/.cache/pip --mount=source=requirements.txt,dst=requirements.txt --mount=from=searxng,source=dist/searxng-1.0.0-py3-none-any.whl,dst=searxng-1.0.0-py3-none-any.whl pip install -r requirements.txt searxng-1.0.0-py3-none-any.whl
COPY searchengine searchengine
COPY templates templates
COPY static static
COPY --from=domains domains.txt .
COPY --from=locales locales locales
COPY --from=scss style.css static/.
ADD https://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js static/.
EXPOSE 80
CMD ["uvicorn", "searchengine:app", "--host", "0.0.0.0", "--port", "80"]