Update Dockerfile
Browse files- Dockerfile +19 -7
Dockerfile
CHANGED
|
@@ -1,11 +1,23 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
|
| 7 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
EXPOSE 7860
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
CMD ["
|
|
|
|
| 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"]
|