diff options
| author | Noémi Ványi <kvch@users.noreply.github.com> | 2019-01-20 14:56:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-20 14:56:49 +0100 |
| commit | deaaf0651a74412d8dcc10c609d50d74065fdc61 (patch) | |
| tree | 242643f4df47df7de127b86af3a5c10787f22ae0 | |
| parent | 3e6d5ba35e198ba7e41c25115caf1612d508402b (diff) | |
| parent | e9b53a12b0a466172ed0d681fdbb45dab1e4140d (diff) | |
Merge pull request #1485 from pelag0s/outgoing-proxy-config
docker: allow configuring http proxy via env variables
| -rw-r--r-- | Dockerfile | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Dockerfile b/Dockerfile index 1680c7bb2..95e21813f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.8 LABEL maintainer="searx <https://github.com/asciimoo/searx>" LABEL description="A privacy-respecting, hackable metasearch engine." -ENV BASE_URL=False IMAGE_PROXY=False +ENV BASE_URL=False IMAGE_PROXY=False HTTP_PROXY_URL= HTTPS_PROXY_URL= EXPOSE 8888 WORKDIR /usr/local/searx CMD ["/sbin/tini","--","/usr/local/searx/run.sh"] @@ -12,6 +12,9 @@ RUN adduser -D -h /usr/local/searx -s /bin/sh searx searx \ && echo 'sed -i "s|base_url : False|base_url : $BASE_URL|g" searx/settings.yml' >> run.sh \ && echo 'sed -i "s/image_proxy : False/image_proxy : $IMAGE_PROXY/g" searx/settings.yml' >> run.sh \ && echo 'sed -i "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml' >> run.sh \ + && echo 'if [ -n "$HTTP_PROXY_URL" ] || [ -n "$HTTPS_PROXY_URL" ]; then' >> run.sh \ + && echo ' sed -i "s~^# proxies :~ proxies:\\n http: ${HTTP_PROXY_URL}\\n https: ${HTTPS_PROXY_URL}\\n~" searx/settings.yml' >> run.sh \ + && echo 'fi' >> run.sh \ && echo 'python searx/webapp.py' >> run.sh \ && chmod +x run.sh |