zyxciss commited on
Commit
5d9b66c
·
verified ·
1 Parent(s): 0f5f2cd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -7
Dockerfile CHANGED
@@ -1,11 +1,23 @@
1
- # Use the official SearXNG image
2
- FROM searxng/searxng:latest
3
 
4
- # Set a writable directory (Hugging Face Spaces may not allow /etc/searxng/)
5
- ENV SEARXNG_SETTINGS_PATH=/workspace/settings.yml
6
 
7
- # Expose port 7860 (Hugging Face uses this for web services)
 
 
 
 
 
 
 
 
 
 
 
 
8
  EXPOSE 7860
9
 
10
- # Run SearXNG with correct permissions
11
- CMD ["gunicorn", "-b", "0.0.0.0:7860", "searx.webapp:app"]
 
1
+ # Use a lightweight Python image
2
+ FROM python:3.10-slim
3
 
4
+ # Install dependencies
5
+ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
6
 
7
+ # Create a non-root user
8
+ RUN useradd -m searxng
9
+ USER searxng
10
+ WORKDIR /home/searxng
11
+
12
+ # Clone SearXNG repository
13
+ RUN git clone --depth=1 https://github.com/searxng/searxng.git
14
+
15
+ # Install SearXNG dependencies
16
+ WORKDIR /home/searxng/searxng
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Expose port 7860 (required for Hugging Face)
20
  EXPOSE 7860
21
 
22
+ # Start SearXNG
23
+ CMD ["python", "-m", "searx.webapp", "--port", "7860"]