Run the Elasticsearch service in a container.

This commit is contained in:
Hulk 2019-04-19 15:20:27 +08:00
parent af3d55b06d
commit f64a44dc2c
2 changed files with 21 additions and 9 deletions

View file

@ -9,10 +9,9 @@ RUN mkdir -p /usr/share/man/man1
RUN apt update RUN apt update
RUN apt-get install -y openjdk-8-jre libmemcached-dev zlib1g-dev pwgen curl openssl poppler-utils libpython2.7 libreoffice \ RUN apt-get install -y libmemcached-dev zlib1g-dev pwgen curl openssl poppler-utils libpython2.7 libreoffice \
libreoffice-script-provider-python ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy python-requests libreoffice-script-provider-python ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy python-requests tzdata \
python-pip python-setuptools python-urllib3 python-ldap python-ceph
RUN apt-get install -y tzdata python-pip python-setuptools python-urllib3 python-ldap python-ceph
# The S3 storage, oss storage and psd online preview etc, # The S3 storage, oss storage and psd online preview etc,
# depends on the python-backages as follow: # depends on the python-backages as follow:

View file

@ -169,6 +169,19 @@ COMPRESS_CACHE_BACKEND = 'locmem'""")
fp.write('UNIX_SOCKET = /opt/seafile/ccnet.sock\n') fp.write('UNIX_SOCKET = /opt/seafile/ccnet.sock\n')
fp.write('\n') fp.write('\n')
# Disabled the Elasticsearch process on Seafile-container
# Connection to the Elasticsearch-container
with open(join(topdir, 'conf', 'seafevents.conf'), 'r') as fp:
fp_lines = fp.readlines()
if '[INDEX FILES]\n' in fp_lines:
insert_index = fp_lines.index('[INDEX FILES]\n') + 1
insert_lines = ['es_port = 9200\n', 'es_host = elasticsearch\n', 'external_es_server = true\n']
for line in insert_lines:
fp_lines.insert(insert_index, line)
with open(join(topdir, 'conf', 'seafevents.conf'), 'w') as fp:
fp.writelines(fp_lines)
# After the setup script creates all the files inside the # After the setup script creates all the files inside the
# container, we need to move them to the shared volume # container, we need to move them to the shared volume
# #