|
@@ -1,9 +1,14 @@
|
1
|
1
|
FROM alpine:3.3
|
2
|
|
-MAINTAINER Wonderfall <wonderfall@opmbx.org>
|
3
|
2
|
|
4
|
3
|
ENV BASE_URL=False IMAGE_PROXY=False
|
5
|
4
|
|
6
|
|
-COPY . /usr/local/searx
|
|
5
|
+EXPOSE 8888
|
|
6
|
+
|
|
7
|
+WORKDIR /usr/local/searx
|
|
8
|
+
|
|
9
|
+CMD ["./run.sh"]
|
|
10
|
+
|
|
11
|
+COPY requirements.txt /usr/local/searx/requirements.txt
|
7
|
12
|
|
8
|
13
|
RUN apk -U add \
|
9
|
14
|
build-base \
|
|
@@ -18,13 +23,7 @@ RUN apk -U add \
|
18
|
23
|
openssl \
|
19
|
24
|
openssl-dev \
|
20
|
25
|
ca-certificates \
|
21
|
|
- && adduser -D -h /usr/local/searx -s /bin/sh searx searx \
|
22
|
|
- && cd /usr/local/searx \
|
23
|
|
- && pip install --no-cache -r requirements.txt \
|
24
|
|
- && sed -i "s/127.0.0.1/0.0.0.0/g" searx/settings.yml \
|
25
|
|
- && sed -i "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml \
|
26
|
|
- && sed -i "s|base_url : False|base_url : $BASE_URL|g" searx/settings.yml \
|
27
|
|
- && sed -i "s/image_proxy : False/image_proxy : $IMAGE_PROXY/g" searx/settings.yml \
|
|
26
|
+ && pip install --no-cache -r /usr/local/searx/requirements.txt \
|
28
|
27
|
&& apk del \
|
29
|
28
|
build-base \
|
30
|
29
|
python-dev \
|
|
@@ -35,10 +34,21 @@ RUN apk -U add \
|
35
|
34
|
libxml2-dev \
|
36
|
35
|
openssl-dev \
|
37
|
36
|
ca-certificates \
|
38
|
|
- && chown -R searx:searx /usr/local/searx \
|
39
|
37
|
&& rm -f /var/cache/apk/*
|
40
|
38
|
|
41
|
|
-EXPOSE 8888
|
|
39
|
+COPY . /usr/local/searx
|
|
40
|
+
|
|
41
|
+RUN adduser -D -h /usr/local/searx -s /bin/sh searx searx \
|
|
42
|
+ && chown -R searx:searx /usr/local/searx
|
|
43
|
+
|
42
|
44
|
USER searx
|
43
|
|
-WORKDIR /usr/local/searx
|
44
|
|
-CMD ["python", "searx/webapp.py"]
|
|
45
|
+
|
|
46
|
+RUN cd /usr/local/searx \
|
|
47
|
+ && sed -i "s/127.0.0.1/0.0.0.0/g" searx/settings.yml \
|
|
48
|
+ && sed -i "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml
|
|
49
|
+
|
|
50
|
+RUN echo '#!/bin/sh' >> run.sh \
|
|
51
|
+ && echo 'sed -i "s|base_url : False|base_url : $BASE_URL|g" searx/settings.yml' >> run.sh \
|
|
52
|
+ && echo 'sed -i "s/image_proxy : False/image_proxy : $IMAGE_PROXY/g" searx.setting.yml' >> run.sh \
|
|
53
|
+ && echo 'python searx/webapp.py' >> run.sh \
|
|
54
|
+ && chmod +x run.sh
|