AnesKAM commited on
Commit
093369b
·
verified ·
1 Parent(s): e45418b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -30
Dockerfile CHANGED
@@ -1,40 +1,42 @@
1
  FROM searxng/searxng:latest
2
 
 
3
  ENV PORT=7860
4
  ENV SEARXNG_PORT=7860
5
- ENV SEARXNG_SETTINGS_PATH=/etc/searxng/settings.yml
6
- USER root
7
 
8
- # إنشاء ملف الإعدادات ببنية كاملة لمنع أخطاء الـ Validation
9
- RUN mkdir -p /etc/searxng && \
10
- echo 'use_default_settings: false' > /etc/searxng/settings.yml && \
11
- echo 'server:' >> /etc/searxng/settings.yml && \
12
- echo ' port: 7860' >> /etc/searxng/settings.yml && \
13
- echo ' bind_address: "0.0.0.0"' >> /etc/searxng/settings.yml && \
14
- echo ' secret_key: "anesnt_secret_secure_key"' >> /etc/searxng/settings.yml && \
15
- echo ' base_url: false' >> /etc/searxng/settings.yml && \
16
- echo 'search:' >> /etc/searxng/settings.yml && \
17
- echo ' formats: ["html", "json"]' >> /etc/searxng/settings.yml && \
18
- echo ' autocomplete: "duckduckgo"' >> /etc/searxng/settings.yml && \
19
- echo 'engines:' >> /etc/searxng/settings.yml && \
20
- echo ' - name: duckduckgo' >> /etc/searxng/settings.yml && \
21
- echo ' engine: duckduckgo' >> /etc/searxng/settings.yml && \
22
- echo ' shortcut: ddg' >> /etc/searxng/settings.yml && \
23
- echo 'ui:' >> /etc/searxng/settings.yml && \
24
- echo ' default_locale: "ar"' >> /etc/searxng/settings.yml && \
25
- echo ' query_in_title: true' >> /etc/searxng/settings.yml && \
26
- echo 'enabled_plugins: ["Basic Metadata"]' >> /etc/searxng/settings.yml
 
 
 
27
 
28
- # سكريبت التشغيل الذي لا ينطفئ
29
- RUN echo '#!/bin/sh' > /start.sh && \
30
- echo 'while true; do' >> /start.sh && \
31
- echo ' python3 -m searx.webapp' >> /start.sh && \
32
- echo ' sleep 3' >> /start.sh && \
33
- echo 'done' >> /start.sh && \
34
- chmod +x /start.sh
 
35
 
36
- RUN chown -R searxng:searxng /etc/searxng
37
  USER searxng
38
  EXPOSE 7860
39
 
40
- CMD ["/start.sh"]
 
1
  FROM searxng/searxng:latest
2
 
3
+ # إعدادات المنفذ
4
  ENV PORT=7860
5
  ENV SEARXNG_PORT=7860
 
 
6
 
7
+ # إعدادات المحرك عبر متغيرات البيئة كثر استقراراً من تعديل الملف)
8
+ ENV SEARXNG_SETTINGS=""
9
+ ENV SEARXNG_SECRET="anesnt_secret_$(openssl rand -hex 16)"
10
+
11
+ # تعطيل المحركات المكسورة وتفعيل DuckDuckGo والـ JSON برمجياً
12
+ ENV SEARXNG_SETTINGS="use_default_settings: false
13
+ server:
14
+ base_url: http://localhost:7860
15
+ search:
16
+ formats:
17
+ - html
18
+ - json
19
+ engines:
20
+ - name: duckduckgo
21
+ engine: duckduckgo
22
+ shortcut: ddg
23
+ - name: wikidata
24
+ disabled: true
25
+ - name: ahmia
26
+ disabled: true"
27
+
28
+ USER root
29
 
30
+ # سكريبت التشغيل الذي يضمن بقاء السيرفر حياً
31
+ RUN echo '#!/bin/sh' > /start_anesnt.sh && \
32
+ echo 'while true; do' >> /start_anesnt.sh && \
33
+ echo ' echo "[Genisi] Starting Stable Engine for AnesNT..."' >> /start_anesnt.sh && \
34
+ echo ' python3 -m searx.webapp' >> /start_anesnt.sh && \
35
+ echo ' sleep 5' >> /start_anesnt.sh && \
36
+ echo 'done' >> /start_anesnt.sh && \
37
+ chmod +x /start_anesnt.sh
38
 
 
39
  USER searxng
40
  EXPOSE 7860
41
 
42
+ CMD ["/start_anesnt.sh"]