sandeepmudhiraj commited on
Commit
c76423d
·
verified ·
1 Parent(s): 5c1b7a8

Upload folder using huggingface_hub

Browse files
Files changed (6) hide show
  1. Dockerfile +33 -8
  2. entrypoint.sh +2 -0
  3. nginx.conf +27 -0
  4. settings.yml +6 -6
  5. supervisord.conf +20 -0
  6. uwsgi.ini +12 -0
Dockerfile CHANGED
@@ -1,16 +1,41 @@
1
- FROM python:3.11-slim
2
 
3
- WORKDIR /app
4
 
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
7
 
8
- COPY . .
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
- RUN useradd -m appuser 2>/dev/null || true
11
  USER 1000
12
 
13
- ENV PORT=7860
14
  EXPOSE 7860
15
 
16
- CMD ["python", "app.py"]
 
 
1
+ FROM ubuntu:22.04
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
 
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ python3 python3-pip python3-dev python3-venv \
7
+ git curl build-essential libffi-dev libssl-dev \
8
+ libyaml-dev libxml2-dev libxslt1-dev zlib1g-dev \
9
+ uwsgi uwsgi-plugin-python3 nginx supervisor tini \
10
+ && rm -rf /var/lib/apt/lists/*
11
 
12
+ WORKDIR /opt
13
+
14
+ # Clone engine (shallow)
15
+ RUN git clone --depth 1 https://github.com/searxng/searxng.git engine
16
+
17
+ # Install engine deps in system python
18
+ RUN cd engine && pip3 install --no-cache-dir --break-system-packages .
19
+
20
+ # Copy config
21
+ COPY settings.yml /etc/engine/settings.yml
22
+ COPY uwsgi.ini /etc/engine/uwsgi.ini
23
+ COPY nginx.conf /etc/nginx/nginx.conf
24
+ COPY supervisord.conf /etc/supervisor/conf.d/app.conf
25
+ COPY entrypoint.sh /entrypoint.sh
26
+
27
+ RUN chmod +x /entrypoint.sh
28
+
29
+ # Setup permissions
30
+ RUN mkdir -p /var/log/supervisor /var/run/supervisor /var/cache/engine && \
31
+ chown -R 1000:1000 /opt/engine /etc/engine /var/log /var/run /var/cache/engine && \
32
+ chown -R 1000:1000 /var/lib/nginx /etc/nginx && \
33
+ touch /run/nginx.pid && chown 1000:1000 /run/nginx.pid
34
 
 
35
  USER 1000
36
 
37
+ ENV SEARXNG_SETTINGS_PATH=/etc/engine/settings.yml
38
  EXPOSE 7860
39
 
40
+ ENTRYPOINT ["/usr/bin/tini", "--"]
41
+ CMD ["/entrypoint.sh"]
entrypoint.sh ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ #!/bin/bash
2
+ exec supervisord -c /etc/supervisor/conf.d/app.conf
nginx.conf ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ worker_processes 1;
2
+ pid /run/nginx.pid;
3
+ error_log /var/log/nginx_error.log warn;
4
+
5
+ events {
6
+ worker_connections 256;
7
+ }
8
+
9
+ http {
10
+ access_log off;
11
+
12
+ upstream backend {
13
+ server 127.0.0.1:8888;
14
+ }
15
+
16
+ server {
17
+ listen 7860;
18
+
19
+ location / {
20
+ proxy_pass http://backend;
21
+ proxy_set_header Host $host;
22
+ proxy_set_header X-Real-IP $remote_addr;
23
+ proxy_connect_timeout 10;
24
+ proxy_read_timeout 30;
25
+ }
26
+ }
27
+ }
settings.yml CHANGED
@@ -2,7 +2,7 @@ use_default_settings: true
2
 
3
  server:
4
  bind_address: "127.0.0.1:8888"
5
- secret_key: "meta_api_internal_key_2026_v3"
6
  limiter: false
7
  image_proxy: false
8
  public_instance: false
@@ -24,6 +24,11 @@ enabled_plugins:
24
  - 'Tracker URL remover'
25
 
26
  engines:
 
 
 
 
 
27
  - name: bing
28
  engine: bing
29
  shortcut: b
@@ -58,8 +63,3 @@ engines:
58
  engine: qwant
59
  shortcut: qw
60
  disabled: false
61
-
62
- - name: google
63
- engine: google
64
- shortcut: g
65
- disabled: false
 
2
 
3
  server:
4
  bind_address: "127.0.0.1:8888"
5
+ secret_key: "meta_api_v5_key_2026"
6
  limiter: false
7
  image_proxy: false
8
  public_instance: false
 
24
  - 'Tracker URL remover'
25
 
26
  engines:
27
+ - name: google
28
+ engine: google
29
+ shortcut: g
30
+ disabled: false
31
+
32
  - name: bing
33
  engine: bing
34
  shortcut: b
 
63
  engine: qwant
64
  shortcut: qw
65
  disabled: false
 
 
 
 
 
supervisord.conf ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [supervisord]
2
+ nodaemon=true
3
+ user=%(ENV_USER)s
4
+ logfile=/var/log/supervisor/supervisord.log
5
+ pidfile=/var/run/supervisor/supervisord.pid
6
+
7
+ [program:engine]
8
+ command=uwsgi --ini /etc/engine/uwsgi.ini
9
+ directory=/opt/engine
10
+ autostart=true
11
+ autorestart=true
12
+ stderr_logfile=/var/log/engine_err.log
13
+ stdout_logfile=/var/log/engine_out.log
14
+
15
+ [program:proxy]
16
+ command=nginx -g "daemon off;"
17
+ autostart=true
18
+ autorestart=true
19
+ stderr_logfile=/var/log/proxy_err.log
20
+ stdout_logfile=/var/log/proxy_out.log
uwsgi.ini ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [uwsgi]
2
+ # Engine runs via uwsgi — process name = "uwsgi"
3
+ http = 127.0.0.1:8888
4
+ module = searx.webapp:app
5
+ master = true
6
+ processes = 2
7
+ threads = 4
8
+ buffer-size = 8192
9
+ thunder-lock = true
10
+ disable-logging = true
11
+ lazy-apps = true
12
+ env = SEARXNG_SETTINGS_PATH=/etc/engine/settings.yml