Update Dockerfile
Browse files- Dockerfile +8 -2
Dockerfile
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 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
|
|
@@ -17,11 +17,17 @@ WORKDIR /home/searxng/searxng
|
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
# Ensure the settings directory exists
|
| 20 |
-
RUN mkdir -p /home/searxng/searxng/searx
|
| 21 |
|
| 22 |
# Generate a secure secret key and save it to settings.yml
|
| 23 |
RUN python3 -c 'import secrets, os; os.makedirs("/home/searxng/searxng/searx", exist_ok=True); open("/home/searxng/searxng/searx/settings.yml", "w").write(f"server:\n secret_key: \"{secrets.token_hex(32)}\"\n")'
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# Expose port 7860 (required for Hugging Face)
|
| 26 |
EXPOSE 7860
|
| 27 |
|
|
|
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Install dependencies
|
| 5 |
+
RUN apt-get update && apt-get install -y git sqlite3 && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
# Create a non-root user
|
| 8 |
RUN useradd -m searxng
|
|
|
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
# Ensure the settings directory exists
|
| 20 |
+
RUN mkdir -p /home/searxng/searxng/searx /etc/searxng
|
| 21 |
|
| 22 |
# Generate a secure secret key and save it to settings.yml
|
| 23 |
RUN python3 -c 'import secrets, os; os.makedirs("/home/searxng/searxng/searx", exist_ok=True); open("/home/searxng/searxng/searx/settings.yml", "w").write(f"server:\n secret_key: \"{secrets.token_hex(32)}\"\n")'
|
| 24 |
|
| 25 |
+
# Fix: Create an empty limiter.toml to prevent warnings
|
| 26 |
+
RUN touch /etc/searxng/limiter.toml
|
| 27 |
+
|
| 28 |
+
# Fix: Set environment variables to avoid SQLite threading errors
|
| 29 |
+
ENV PYTHONWARNINGS=ignore SQLITE_BUSY_TIMEOUT=5000
|
| 30 |
+
|
| 31 |
# Expose port 7860 (required for Hugging Face)
|
| 32 |
EXPOSE 7860
|
| 33 |
|