Last active
May 29, 2017 20:29
-
-
Save mgax/2ffc9c4ccd717ab671241b680a4b74ea to your computer and use it in GitHub Desktop.
Docker compose configuration for hoover
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "2" | |
services: | |
snoop-pg: | |
image: postgres:9.6 | |
volumes: | |
- ./docker-volumes/snoop-pg/data:/var/lib/postgresql/data | |
environment: | |
POSTGRES_USER: snoop | |
POSTGRES_DATABASE: snoop | |
snoop-tika: | |
image: logicalspark/docker-tikaserver | |
snoop: | |
build: ./snoop | |
command: python3 manage.py runserver 0.0.0.0:8001 | |
volumes: | |
- ./snoop:/opt/hoover/snoop | |
- ./cache:/opt/hoover/cache | |
- ./datasets:/opt/hoover/datasets | |
- ./testdata:/opt/hoover/testdata | |
- ./docker-snoop-settings.py:/opt/hoover/snoop/snoop/site/settings/local.py | |
ports: | |
- 8001:8001 | |
depends_on: | |
- snoop-pg | |
- snoop-tika | |
- search-es | |
env_file: | |
- docker-snoop.env | |
search-pg: | |
image: postgres:9.6 | |
volumes: | |
- ./docker-volumes/search-pg/data:/var/lib/postgresql/data | |
environment: | |
POSTGRES_USER: search | |
POSTGRES_DATABASE: search | |
search-es: | |
image: elasticsearch:2 | |
volumes: | |
- ./docker-volumes/search-es/data:/usr/share/elasticsearch/data | |
ui: | |
build: ./ui | |
command: node build.js | |
volumes: | |
- ./ui/build:/opt/hoover/ui/build | |
search: | |
build: ./search | |
command: python3 manage.py runserver 0.0.0.0:8000 | |
volumes: | |
- ./search:/opt/hoover/search | |
- ./ui/build:/opt/hoover/ui/build | |
- ./metrics:/opt/hoover/metrics | |
- ./docker-search-settings.py:/opt/hoover/search/hoover/site/settings/local.py | |
ports: | |
- 8000:8000 | |
depends_on: | |
- search-pg | |
- search-es | |
- ui | |
- snoop | |
env_file: | |
- docker-search.env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.parse import urlparse | |
import os | |
from pathlib import Path | |
base_dir = Path(__file__).absolute().parent.parent.parent.parent | |
SECRET_KEY = os.environ['DOCKER_HOOVER_SEARCH_SECRET_KEY'] | |
HOOVER_BASE_URL = os.environ['DOCKER_HOOVER_BASE_URL'] | |
ALLOWED_HOSTS = [urlparse('http://hoover.docker.tufa').netloc] | |
DEBUG = bool(os.environ.get('DOCKER_HOOVER_SEARCH_DEBUG')) | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
'NAME': 'search', | |
'USER': 'search', | |
'HOST': 'search-pg', | |
'PORT': 5432, | |
}, | |
} | |
STATIC_ROOT = str(base_dir / 'static') | |
HOOVER_UPLOADS_ROOT = str(base_dir / 'uploads') | |
HOOVER_UI_ROOT = str(base_dir.parent / 'ui' / 'build') | |
HOOVER_EVENTS_DIR = str(base_dir.parent / 'metrics' / 'users') | |
HOOVER_ELASTICSEARCH_URL = 'http://search-es:9200' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from pathlib import Path | |
base_dir = Path(__file__).absolute().parent.parent.parent.parent | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
'NAME': 'snoop', | |
'USER': 'snoop', | |
'HOST': 'snoop-pg', | |
'PORT': 5432, | |
}, | |
} | |
SECRET_KEY = os.environ['DOCKER_HOOVER_SNOOP_SECRET_KEY'] | |
DEBUG = bool(os.environ.get('DOCKER_HOOVER_SEARCH_DEBUG')) | |
ALLOWED_HOSTS = ['snoop'] | |
SNOOP_ELASTICSEARCH_URL = 'http://search-es:9200' | |
SNOOP_TIKA_SERVER_ENDPOINT = 'http://snoop-tika:9998' | |
SNOOP_TIKA_FILE_TYPES = ['doc', 'pdf', 'xls', 'ppt'] | |
SNOOP_TIKA_MAX_FILE_SIZE = 32 * (2 ** 20) # 32mb | |
SNOOP_MSGCONVERT_SCRIPT = 'msgconvert' | |
SNOOP_MSG_CACHE = str(base_dir.parent / 'cache' / 'msg') | |
SNOOP_ARCHIVE_CACHE_ROOT = str(base_dir.parent / 'cache' / 'archive') | |
SNOOP_SEVENZIP_BINARY = '7z' | |
SNOOP_ELASTICSEARCH_INDEX = 'hoover' | |
SNOOP_READPST_BINARY = 'readpst' | |
SNOOP_PST_CACHE_ROOT = str(base_dir.parent / 'cache' / 'pst') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment