adowu commited on
Commit
b396485
·
verified ·
1 Parent(s): 4270988

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -15
Dockerfile CHANGED
@@ -1,22 +1,39 @@
 
1
  FROM python:3.12
2
 
3
- WORKDIR /usr/local/searx
 
4
 
5
- RUN apt-get update && apt-get install -y \
6
- python3-dev python3-babel python3-venv \
7
- uwsgi uwsgi-plugin-python3 \
8
- git build-essential libxslt-dev zlib1g-dev libffi-dev libssl-dev \
9
- shellcheck
10
 
11
- COPY ./searx /usr/local/searx/searx
12
- RUN git -C /usr/local/searx/searx init && git -C /usr/local/searx/searx remote add origin https://github.com/searx/searx.git && git -C /usr/local/searx/searx fetch && git -C /usr/local/searx/searx reset --hard origin/master && rm -rf /usr/local/searx/searx/.git
13
- RUN python3 -m venv /usr/local/searx/searx-pyenv \
14
- && echo '. /usr/local/searx/searx-pyenv/bin/activate' >> /usr/local/searx/.profile \
15
- && source /usr/local/searx/.profile \
16
- && pip install -U pip setuptools wheel pyyaml \
17
- && pip install -e /usr/local/searx/searx
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  ENV SEARX_SETTINGS_PATH=/etc/searx/settings.yml
20
- COPY ./settings.yml /etc/searx/settings.yml
21
 
22
- CMD ["uwsgi", "--emperor", "/etc/searx/conf.d"]
 
 
 
 
 
 
 
 
1
+ # Użyj oficjalnego obrazu Python 3.12 jako podstawy
2
  FROM python:3.12
3
 
4
+ # Ustaw katalog roboczy
5
+ WORKDIR /code
6
 
7
+ # Skopiuj plik requirements.txt do kontenera
8
+ COPY requirements.txt .
 
 
 
9
 
10
+ # Zainstaluj wymagane pakiety
11
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
12
 
13
+ # Skopiuj zawartość katalogu searx-src do kontenera
14
+ COPY searx-src /code/searx-src
15
+
16
+ # Ustaw środowisko wirtualne jako domyślne dla interpretera Pythona
17
+ ENV VIRTUAL_ENV=/usr/local/searx/searx-pyenv
18
+ RUN echo "source $VIRTUAL_ENV/bin/activate" > /etc/profile.d/searx-pyenv.sh
19
+
20
+ # Utwórz użytkownika searx i ustaw uprawnienia
21
+ RUN useradd -m -s /bin/bash searx && chown -R searx:searx /code
22
+ USER searx
23
+
24
+ # Uruchom polecenie, aby sklonować repozytorium Searx i zainstalować zależności
25
+ RUN git clone https://github.com/searx/searx.git /code/searx-src && \
26
+ cd /code/searx-src && \
27
+ pip install -e .
28
+
29
+ # Ustaw zmienną środowiskową wskazującą ścieżkę do pliku ustawień
30
  ENV SEARX_SETTINGS_PATH=/etc/searx/settings.yml
 
31
 
32
+ # Skopiuj domyślny plik ustawień do kontenera
33
+ COPY utils/templates/etc/searx/use_default_settings.yml /etc/searx/settings.yml
34
+
35
+ # Udostępnij port 8888
36
+ EXPOSE 8888
37
+
38
+ # Ustaw polecenie uruchamiające aplikację Searx
39
+ CMD ["python", "searx/webapp.py"]