Commit ba033872 authored by Nicolas Gelot's avatar Nicolas Gelot

Rework python and docker packages

parent 0203737b
FROM python:3.7-alpine as builder
RUN apk add \
git \
build-base \
libxml2-dev \
libxslt-dev \
libffi-dev \
openssl-dev
# Only to use the docker cache and optimize the build time
WORKDIR /src
COPY requirements.txt /src/requirements.txt
RUN pip3 install --prefix /install -r requirements.txt
COPY . /src/
RUN PYTHONPATH=/install/lib/python3.7/site-packages/ python3 setup.py install --prefix /install
FROM python:3.7-alpine
LABEL maintainer="searx <https://github.com/asciimoo/searx>"
LABEL description="A privacy-respecting, hackable metasearch engine."
EXPOSE 8888
WORKDIR /usr/local/searx
CMD ["python", "searx/webapp.py"]
COPY requirements.txt ./requirements.txt
RUN apk -U add \
build-base \
libxml2 \
libxml2-dev \
libxslt \
libxslt-dev \
libffi-dev \
openssl \
openssl-dev \
ca-certificates \
&& pip install -r requirements.txt \
&& pip install coverage \
&& apk del \
build-base \
libffi-dev \
openssl-dev \
libxslt-dev \
libxml2-dev \
openssl-dev \
ca-certificates \
&& rm -f /var/cache/apk/*
COPY searx /usr/local/searx/searx
RUN sed -i "s/127.0.0.1/0.0.0.0/g" searx/settings.yml
RUN apk add \
ca-certificates \
libxslt \
openssl \
&& pip install coverage
COPY --from=builder /install/ /usr/local/
EXPOSE 8888
STOPSIGNAL SIGINT
CMD ["searx-run"]
......@@ -7,7 +7,7 @@ services:
- run
- --source=searx
command:
- searx/webapp.py
- /usr/local/bin/searx-run
volumes:
- coverage:/coverage
environment:
......
......@@ -59,7 +59,7 @@ functional_tests() {
}
coverage() {
sed -i 's!/usr/local/searx!'$BASE_DIR'!g' "$COV_DIR"/func
sed -i 's!/usr/local/lib/python3.7/site-packages/searx[^/]*/searx!'$SEARX_DIR'!g' "$COV_DIR"/func
coverage3 combine coverage/func coverage/unit
coverage3 report
}
......
......@@ -11,7 +11,7 @@ search:
server:
port : 8888
bind_address : "127.0.0.1" # address to listen on
bind_address : "0.0.0.0" # address to listen on
secret_key : "ultrasecretkey" # change this!
base_url : False # Set custom base_url. Possible values: False or "https://your.custom.host/location/"
image_proxy : False # Proxying image results through searx
......
......@@ -16,11 +16,9 @@ along with searx. If not, see < http://www.gnu.org/licenses/ >.
(C) 2013- by Adam Tauber, <asciimoo@gmail.com>
'''
# version of searx
VERSION_MAJOR = 0
VERSION_MINOR = 15
VERSION_BUILD = 0
from pkg_resources import get_distribution, DistributionNotFound
VERSION_STRING = "{0}.{1}.{2}".format(VERSION_MAJOR,
VERSION_MINOR,
VERSION_BUILD)
try:
VERSION_STRING = get_distribution("searx").version
except DistributionNotFound:
VERSION_STRING = "0.0.0"
......@@ -4,27 +4,15 @@
from setuptools import setup
from setuptools import find_packages
import os
import sys
# required to load VERSION_STRING constant
sys.path.insert(0, './searx')
from version import VERSION_STRING
def read(*rnames):
return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
long_description = read('README.rst')
requirements = map(str.strip, open('requirements.txt').readlines())
dev_requirements = map(str.strip, open('requirements-dev.txt').readlines())
requirements = open('requirements.txt').read().splitlines()
dev_requirements = open('requirements-dev.txt').read().splitlines()
setup(
name='searx',
version=VERSION_STRING,
use_scm_version=True,
description="A privacy-respecting, hackable metasearch engine",
long_description=long_description,
long_description=open('README.rst').read(),
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python",
......@@ -41,6 +29,7 @@ setup(
packages=find_packages(exclude=["tests*"]),
zip_safe=False,
install_requires=requirements,
setup_requires=["setuptools_scm"],
extras_require={
'test': dev_requirements
},
......@@ -52,9 +41,6 @@ setup(
package_data={
'searx': [
'settings.yml',
'../README.rst',
'../requirements.txt',
'../requirements-dev.txt',
'data/*',
'plugins/*/*',
'static/*.*',
......@@ -64,11 +50,7 @@ setup(
'static/*/*/*/*/*.*',
'templates/*/*.*',
'templates/*/*/*.*',
'tests/*',
'tests/*/*',
'tests/*/*/*',
'translations/*/*/*'
],
},
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment