version: "3.4"
# NEODB Docker Compose File
#
# Note: configuration here may not be secure for production usage
x-shared:
neodb-service: &neodb-service
build: .
image: neodb:latest
env_file:
- neodb.env
environment:
- NEODB_DB_NAME=neodb
- NEODB_DB_USER=neodb
- NEODB_DB_PASSWORD=aubergine
- NEODB_DB_HOST=neodb-db
- NEODB_DB_PORT=5432
- NEODB_REDIS_HOST=neodb-redis
- NEODB_REDIS_PORT=6379
- NEODB_REDIS_DB=0
- NEODB_TYPESENSE_ENABLE=1
- NEODB_TYPESENSE_HOST=neodb-search
- NEODB_TYPESENSE_PORT=8108
- NEODB_TYPESENSE_KEY=eggplant
- NEODB_STATIC_ROOT=/www/static/
- NEODB_MEDIA_ROOT=/www/media/
restart: "on-failure"
volumes:
- ${NEODB_DATA:-../data}/neodb-media:/www/media
depends_on:
- neodb-redis
- neodb-db
- neodb-search
services:
neodb-redis:
image: redis:alpine
ports:
- "16379:6379"
neodb-search:
image: typesense/typesense:0.25.0
healthcheck:
test: ['CMD', 'curl', '-vf', 'http://127.0.0.1:8108/health']
# ports:
# - "18108:8108"
GLOG_minloglevel: 2
- ${NEODB_DATA:-../data}/typesense:/data
command: '--data-dir /data --api-key=eggplant'
neodb-db:
image: postgres:14-alpine
test: ['CMD', 'pg_isready', '-U', 'neodb']
- ${NEODB_DATA:-../data}/neodb-data:/var/lib/postgresql/data
# - "15432:5432"
- POSTGRES_DB=neodb
- POSTGRES_USER=neodb
- POSTGRES_PASSWORD=aubergine
migration:
<<: *neodb-service
restart: "no"
command: python /neodb/manage.py migrate
condition: service_healthy
condition: service_started
neodb-web:
# - "18000:8000"
command: gunicorn boofilsic.wsgi -w 8 --preload -b 0.0.0.0:8000
condition: service_completed_successfully
neodb-worker:
command: python /neodb/manage.py rqworker --with-scheduler import export mastodon fetch crawl
neodb-worker-secondary:
command: python /neodb/manage.py rqworker --with-scheduler fetch crawl
neodb-nginx:
command: nginx
- "${NEODB_PORT:-8000}:8000"