adowu commited on
Commit
f4eefc6
·
verified ·
1 Parent(s): 543cd4e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +76 -14
Dockerfile CHANGED
@@ -1,8 +1,29 @@
1
- FROM alpine
2
- WORKDIR /code
 
 
3
 
4
- RUN apk upgrade --no-cache \
5
- && apk add --no-cache -t build-dependencies \
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  build-base \
7
  py3-setuptools \
8
  python3-dev \
@@ -12,17 +33,58 @@ RUN apk upgrade --no-cache \
12
  openssl-dev \
13
  tar \
14
  git \
15
- docker \
16
- docker-compose \
17
- curl
18
-
19
- RUN git clone https://github.com/arturwyroslak/searxng-docker
20
- WORKDIR /code/searxng-docker
 
 
 
 
 
 
 
 
 
21
 
 
 
22
 
23
- RUN apk add --no-cache openssl
24
- RUN sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml
 
25
 
26
- EXPOSE 80
 
 
 
 
 
27
 
28
- CMD ["docker-compose", "up", "-d"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine:3.19
2
+ ENTRYPOINT ["/sbin/tini","--","/usr/local/searxng/dockerfiles/docker-entrypoint.sh"]
3
+ EXPOSE 8080
4
+ VOLUME /etc/searxng
5
 
6
+ ARG SEARXNG_GID=977
7
+ ARG SEARXNG_UID=977
8
+
9
+ RUN addgroup -g ${SEARXNG_GID} searxng && \
10
+ adduser -u ${SEARXNG_UID} -D -h /usr/local/searxng -s /bin/sh -G searxng searxng
11
+
12
+ ENV INSTANCE_NAME=searxng \
13
+ AUTOCOMPLETE= \
14
+ BASE_URL= \
15
+ MORTY_KEY= \
16
+ MORTY_URL= \
17
+ SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml \
18
+ UWSGI_SETTINGS_PATH=/etc/searxng/uwsgi.ini \
19
+ UWSGI_WORKERS=%k \
20
+ UWSGI_THREADS=4
21
+
22
+ WORKDIR /usr/local/searxng
23
+
24
+ COPY requirements.txt ./requirements.txt
25
+
26
+ RUN apk add --no-cache -t build-dependencies \
27
  build-base \
28
  py3-setuptools \
29
  python3-dev \
 
33
  openssl-dev \
34
  tar \
35
  git \
36
+ && apk add --no-cache \
37
+ ca-certificates \
38
+ su-exec \
39
+ python3 \
40
+ py3-pip \
41
+ libxml2 \
42
+ libxslt \
43
+ openssl \
44
+ tini \
45
+ uwsgi \
46
+ uwsgi-python3 \
47
+ brotli \
48
+ && pip3 install --break-system-packages --no-cache -r requirements.txt \
49
+ && apk del build-dependencies \
50
+ && rm -rf /root/.cache
51
 
52
+ COPY --chown=searxng:searxng dockerfiles ./dockerfiles
53
+ COPY --chown=searxng:searxng searx ./searx
54
 
55
+ ARG TIMESTAMP_SETTINGS=0
56
+ ARG TIMESTAMP_UWSGI=0
57
+ ARG VERSION_GITCOMMIT=unknown
58
 
59
+ RUN su searxng -c "/usr/bin/python3 -m compileall -q searx" \
60
+ && touch -c --date=@${TIMESTAMP_SETTINGS} searx/settings.yml \
61
+ && touch -c --date=@${TIMESTAMP_UWSGI} dockerfiles/uwsgi.ini \
62
+ && find /usr/local/searxng/searx/static -a \( -name '*.html' -o -name '*.css' -o -name '*.js' \
63
+ -o -name '*.svg' -o -name '*.ttf' -o -name '*.eot' \) \
64
+ -type f -exec gzip -9 -k {} \+ -exec brotli --best {} \+
65
 
66
+ # Keep these arguments at the end to prevent redundant layer rebuilds
67
+ ARG LABEL_DATE=
68
+ ARG GIT_URL=unknown
69
+ ARG SEARXNG_GIT_VERSION=unknown
70
+ ARG SEARXNG_DOCKER_TAG=unknown
71
+ ARG LABEL_VCS_REF=
72
+ ARG LABEL_VCS_URL=
73
+ LABEL maintainer="searxng <${GIT_URL}>" \
74
+ description="A privacy-respecting, hackable metasearch engine." \
75
+ version="${SEARXNG_GIT_VERSION}" \
76
+ org.label-schema.schema-version="1.0" \
77
+ org.label-schema.name="searxng" \
78
+ org.label-schema.version="${SEARXNG_GIT_VERSION}" \
79
+ org.label-schema.url="${LABEL_VCS_URL}" \
80
+ org.label-schema.vcs-ref=${LABEL_VCS_REF} \
81
+ org.label-schema.vcs-url=${LABEL_VCS_URL} \
82
+ org.label-schema.build-date="${LABEL_DATE}" \
83
+ org.label-schema.usage="https://github.com/searxng/searxng-docker" \
84
+ org.opencontainers.image.title="searxng" \
85
+ org.opencontainers.image.version="${SEARXNG_DOCKER_TAG}" \
86
+ org.opencontainers.image.url="${LABEL_VCS_URL}" \
87
+ org.opencontainers.image.revision=${LABEL_VCS_REF} \
88
+ org.opencontainers.image.source=${LABEL_VCS_URL} \
89
+ org.opencontainers.image.created="${LABEL_DATE}" \
90
+ org.opencontainers.image.documentation="https://github.com/searxng/searxng-docker"