2023-08-17 18:54:00 -04:00
|
|
|
version: "3.8"
|
2023-08-17 02:09:36 -04:00
|
|
|
|
|
|
|
# NEODB Docker Compose File
|
|
|
|
#
|
2023-08-17 18:54:00 -04:00
|
|
|
# Note: may not be secure for production usage, use at your own risk
|
|
|
|
#
|
|
|
|
# The following env variable are expected from .env or command line
|
|
|
|
# - NEODB_SECRET_KEY
|
|
|
|
# - NEODB_SITE_DOMAIN
|
|
|
|
# - NEODB_SITE_NAME
|
|
|
|
# - NEODB_DATA
|
2023-08-17 02:09:36 -04:00
|
|
|
|
|
|
|
x-shared:
|
|
|
|
neodb-service: &neodb-service
|
|
|
|
build: .
|
2023-08-19 21:59:43 +00:00
|
|
|
image: neodb/neodb:${TAG:-latest}
|
2023-08-17 02:09:36 -04:00
|
|
|
environment:
|
|
|
|
- NEODB_DB_NAME=neodb
|
|
|
|
- NEODB_DB_USER=neodb
|
|
|
|
- NEODB_DB_PASSWORD=aubergine
|
|
|
|
- NEODB_DB_HOST=neodb-db
|
|
|
|
- NEODB_DB_PORT=5432
|
2023-08-17 18:54:00 -04:00
|
|
|
- NEODB_REDIS_HOST=redis
|
2023-08-17 02:09:36 -04:00
|
|
|
- NEODB_REDIS_PORT=6379
|
|
|
|
- NEODB_REDIS_DB=0
|
|
|
|
- NEODB_TYPESENSE_ENABLE=1
|
2023-08-17 18:54:00 -04:00
|
|
|
- NEODB_TYPESENSE_HOST=typesense
|
2023-08-17 02:09:36 -04:00
|
|
|
- NEODB_TYPESENSE_PORT=8108
|
|
|
|
- NEODB_TYPESENSE_KEY=eggplant
|
2023-08-17 18:54:00 -04:00
|
|
|
- NEODB_FROM_EMAIL=no-reply@${NEODB_SITE_DOMAIN}
|
|
|
|
- NEODB_MEDIA_ROOT=/www/m/
|
|
|
|
- TAKAHE_DB_NAME=takahe
|
|
|
|
- TAKAHE_DB_USER=takahe
|
|
|
|
- TAKAHE_DB_PASSWORD=aubergine
|
|
|
|
- TAKAHE_DB_HOST=takahe-db
|
|
|
|
- TAKAHE_DB_PORT=5432
|
|
|
|
- TAKAHE_SECRET_KEY=${NEODB_SECRET_KEY}
|
|
|
|
- TAKAHE_MAIN_DOMAIN=${NEODB_SITE_DOMAIN}
|
|
|
|
- TAKAHE_MEDIA_URL=https://${NEODB_SITE_DOMAIN}/media/
|
|
|
|
- TAKAHE_EMAIL_FROM=no-reply@${NEODB_SITE_DOMAIN}
|
|
|
|
- TAKAHE_DATABASE_SERVER=postgres://takahe:aubergine@takahe-db/takahe
|
|
|
|
- TAKAHE_CACHES_DEFAULT=redis://redis:6379/0
|
|
|
|
- TAKAHE_MEDIA_BACKEND=local://www/media/
|
|
|
|
- TAKAHE_MEDIA_ROOT=/www/media/
|
|
|
|
- TAKAHE_USE_PROXY_HEADERS=true
|
|
|
|
- TAKAHE_STATOR_CONCURRENCY=4
|
|
|
|
- TAKAHE_STATOR_CONCURRENCY_PER_MODEL=2
|
|
|
|
- TAKAHE_DEBUG=${NEODB_DEBUG:-False}
|
2023-08-17 02:09:36 -04:00
|
|
|
restart: "on-failure"
|
|
|
|
volumes:
|
2023-08-17 18:54:00 -04:00
|
|
|
- ${NEODB_DATA:-../data}/neodb-media:/www/m
|
|
|
|
- ${NEODB_DATA:-../data}/takahe-media:/www/media
|
|
|
|
- ${NEODB_DATA:-../data}/takahe-cache:/www/cache
|
|
|
|
- ${NEODB_DATA:-../data}/www-root:/www/root
|
|
|
|
# - ${NEODB_DATA:-../data}/log:/var/log/nginx
|
2023-08-17 02:09:36 -04:00
|
|
|
depends_on:
|
2023-08-17 18:54:00 -04:00
|
|
|
- redis
|
2023-08-17 02:09:36 -04:00
|
|
|
- neodb-db
|
2023-08-17 18:54:00 -04:00
|
|
|
- typesense
|
|
|
|
- takahe-db
|
2022-11-09 13:56:50 -05:00
|
|
|
|
|
|
|
services:
|
2023-08-17 18:54:00 -04:00
|
|
|
redis:
|
2022-11-09 13:56:50 -05:00
|
|
|
image: redis:alpine
|
2023-08-17 18:54:00 -04:00
|
|
|
# ports:
|
|
|
|
# - "16379:6379"
|
|
|
|
command: redis-server --save 60 1 --loglevel warning
|
|
|
|
volumes:
|
|
|
|
- ${NEODB_DATA:-../data}/redis:/data
|
2022-11-09 13:56:50 -05:00
|
|
|
|
2023-08-17 18:54:00 -04:00
|
|
|
typesense:
|
2023-08-17 02:09:36 -04:00
|
|
|
image: typesense/typesense:0.25.0
|
|
|
|
restart: "on-failure"
|
2023-08-17 18:54:00 -04:00
|
|
|
# healthcheck:
|
|
|
|
# test: ['CMD', 'curl', '-vf', 'http://127.0.0.1:8108/health']
|
2023-08-17 02:09:36 -04:00
|
|
|
# ports:
|
|
|
|
# - "18108:8108"
|
2022-11-09 13:56:50 -05:00
|
|
|
environment:
|
2023-08-17 02:09:36 -04:00
|
|
|
GLOG_minloglevel: 2
|
|
|
|
volumes:
|
|
|
|
- ${NEODB_DATA:-../data}/typesense:/data
|
|
|
|
command: '--data-dir /data --api-key=eggplant'
|
2022-11-09 13:56:50 -05:00
|
|
|
|
2023-08-17 02:09:36 -04:00
|
|
|
neodb-db:
|
|
|
|
image: postgres:14-alpine
|
|
|
|
healthcheck:
|
|
|
|
test: ['CMD', 'pg_isready', '-U', 'neodb']
|
2022-11-09 13:56:50 -05:00
|
|
|
volumes:
|
2023-08-17 18:54:00 -04:00
|
|
|
- ${NEODB_DATA:-../data}/neodb-db:/var/lib/postgresql/data
|
2023-08-17 02:09:36 -04:00
|
|
|
# ports:
|
|
|
|
# - "15432:5432"
|
2022-11-09 13:56:50 -05:00
|
|
|
environment:
|
2023-08-17 02:09:36 -04:00
|
|
|
- POSTGRES_DB=neodb
|
|
|
|
- POSTGRES_USER=neodb
|
|
|
|
- POSTGRES_PASSWORD=aubergine
|
|
|
|
|
2023-08-17 18:54:00 -04:00
|
|
|
takahe-db:
|
|
|
|
image: postgres:14-alpine
|
|
|
|
healthcheck:
|
|
|
|
test: ['CMD', 'pg_isready', '-U', 'takahe']
|
|
|
|
volumes:
|
|
|
|
- ${NEODB_DATA:-../data}/takahe-db:/var/lib/postgresql/data
|
|
|
|
# ports:
|
|
|
|
# - "16432:5432"
|
|
|
|
environment:
|
|
|
|
- POSTGRES_DB=takahe
|
|
|
|
- POSTGRES_USER=takahe
|
|
|
|
- POSTGRES_PASSWORD=aubergine
|
|
|
|
|
2023-08-17 02:09:36 -04:00
|
|
|
migration:
|
|
|
|
<<: *neodb-service
|
|
|
|
restart: "no"
|
2023-08-19 21:59:43 +00:00
|
|
|
command: "sh -c '/takahe/.venv/bin/python /takahe/manage.py migrate && /neodb/.venv/bin/python /neodb/manage.py migrate'"
|
2023-08-17 02:09:36 -04:00
|
|
|
depends_on:
|
|
|
|
neodb-db:
|
|
|
|
condition: service_healthy
|
2023-08-17 18:54:00 -04:00
|
|
|
typesense:
|
2023-08-17 02:09:36 -04:00
|
|
|
condition: service_started
|
2023-08-17 18:54:00 -04:00
|
|
|
redis:
|
2023-08-17 02:09:36 -04:00
|
|
|
condition: service_started
|
2023-08-17 18:54:00 -04:00
|
|
|
takahe-db:
|
|
|
|
condition: service_healthy
|
2023-08-17 02:09:36 -04:00
|
|
|
|
|
|
|
neodb-web:
|
|
|
|
<<: *neodb-service
|
|
|
|
# ports:
|
|
|
|
# - "18000:8000"
|
2023-08-19 21:59:43 +00:00
|
|
|
command: /neodb/.venv/bin/gunicorn boofilsic.wsgi -w ${NEODB_WEB_WORKER_NUM:-8} --preload -b 0.0.0.0:8000
|
2023-08-17 18:54:00 -04:00
|
|
|
healthcheck:
|
|
|
|
test: ['CMD', 'wget', '-qO/tmp/test', 'http://127.0.0.1:8000/discover/']
|
2023-08-17 02:09:36 -04:00
|
|
|
depends_on:
|
|
|
|
migration:
|
|
|
|
condition: service_completed_successfully
|
|
|
|
|
|
|
|
neodb-worker:
|
|
|
|
<<: *neodb-service
|
2023-08-19 21:59:43 +00:00
|
|
|
command: /neodb/.venv/bin/python /neodb/manage.py rqworker --with-scheduler import export mastodon fetch crawl
|
2022-11-09 13:56:50 -05:00
|
|
|
depends_on:
|
2023-08-17 02:09:36 -04:00
|
|
|
migration:
|
|
|
|
condition: service_completed_successfully
|
|
|
|
|
2023-08-17 18:54:00 -04:00
|
|
|
neodb-worker-extra:
|
2023-08-17 02:09:36 -04:00
|
|
|
<<: *neodb-service
|
2023-08-19 21:59:43 +00:00
|
|
|
command: /neodb/.venv/bin/python /neodb/manage.py rqworker --with-scheduler fetch crawl
|
2023-08-17 02:09:36 -04:00
|
|
|
depends_on:
|
|
|
|
migration:
|
|
|
|
condition: service_completed_successfully
|
|
|
|
|
2023-08-17 18:54:00 -04:00
|
|
|
takahe-web:
|
2023-08-17 02:09:36 -04:00
|
|
|
<<: *neodb-service
|
2023-08-17 18:54:00 -04:00
|
|
|
# ports:
|
|
|
|
# - "19000:8000"
|
2023-08-19 21:59:43 +00:00
|
|
|
command: /takahe/.venv/bin/gunicorn --chdir /takahe takahe.wsgi -w ${TAKAHE_WEB_WORKER_NUM:-8} --preload -b 0.0.0.0:8000
|
2023-08-17 18:54:00 -04:00
|
|
|
healthcheck:
|
|
|
|
test: ['CMD', 'wget', '-qO/tmp/test', 'http://127.0.0.1:8000/nodeinfo/2.0/']
|
2023-08-17 02:09:36 -04:00
|
|
|
depends_on:
|
2023-08-17 18:54:00 -04:00
|
|
|
migration:
|
|
|
|
condition: service_completed_successfully
|
|
|
|
|
|
|
|
takahe-stator:
|
|
|
|
<<: *neodb-service
|
2023-08-19 21:59:43 +00:00
|
|
|
command: /takahe/.venv/bin/python /takahe/manage.py runstator
|
2023-08-17 18:54:00 -04:00
|
|
|
depends_on:
|
|
|
|
migration:
|
|
|
|
condition: service_completed_successfully
|
|
|
|
|
|
|
|
nginx:
|
|
|
|
<<: *neodb-service
|
|
|
|
user: "root:root"
|
|
|
|
command: nginx -g 'daemon off;'
|
|
|
|
depends_on:
|
|
|
|
takahe-web:
|
|
|
|
condition: service_started
|
2023-08-17 02:09:36 -04:00
|
|
|
neodb-web:
|
|
|
|
condition: service_started
|
|
|
|
ports:
|
|
|
|
- "${NEODB_PORT:-8000}:8000"
|
2023-08-17 18:54:00 -04:00
|
|
|
|
|
|
|
shell:
|
|
|
|
<<: *neodb-service
|
|
|
|
command: bash
|
|
|
|
profiles: ["tools"]
|
|
|
|
|
|
|
|
root:
|
|
|
|
<<: *neodb-service
|
|
|
|
command: bash
|
|
|
|
profiles: ["tools"]
|
|
|
|
user: "root:root"
|