eBooru/docker-compose.yml
Earlopain 3a58ac0938
Switch to OpenSearch (#550)
Run the following commands to import data into OpenSearch:

Post.document_store.create_index!
PostVersion.document_store.create_index!
Post.document_store.import
PostVersion.document_store.import

* Add opensearch client

* Add url param to force use opensearch

* Switch import method over to opensearch

* Index to opensearch as well

* Add option to gradually roll out os

* Index os with separate queue

* Move os post creation to job as well

* Exclusively use the OpenSearch client

* Stop enqueuing OsIndexUpdateJob

* Remove remaining elasticsearch code

Bump faraday since v2 is no longer blocked
2023-10-02 18:57:07 +02:00

193 lines
5.0 KiB
YAML

version: "3"
x-environment: &common-env
DANBOORU_HOSTNAME: http://localhost:${EXPOSED_SERVER_PORT:-3000}
DANBOORU_REDIS_URL: redis://redis
DANBOORU_OPENSEARCH_HOST: opensearch
DANBOORU_MEMCACHED_SERVERS: memcached
DANBOORU_IQDB_SERVER: http://iqdb:5588
DANBOORU_DISCORD_SITE: http://localhost:8000
DANBOORU_DISCORD_SECRET: super_secret_for_url_discord
# These are just development secrets, do not use them in production
DANBOORU_PROTECTED_FILE_SECRET: 6686a6413d90c43d5e82403ef271ec25d13cc24e3bfcdd094e73d1eff22a3567
DANBOORU_REPLACEMENT_FILE_SECRET: b35bc54cdc0d0436fc5867c7ef88f9b10a37ae20a06b37e67614fe60019d7bb1
SECRET_TOKEN: 1c58518a891eff4520cadc59afa9e378a9325f1247544ff258096e497f095f45
SESSION_SECRET_KEY: 44b4f44e9f253c406cbe727d403d500c1cecff943e4d2aea8f5447f28846fffe
x-depends-on: &common-depends-on
opensearch:
condition: service_healthy
memcached:
condition: service_started
postgres:
condition: service_started
redis:
condition: service_started
services:
e621:
build:
context: ./
args:
COMPOSE_PROFILES: ${COMPOSE_PROFILES-}
image: e621
volumes:
- .:/app
- node_modules:/app/node_modules
- public_packs:/app/public/packs
- post_data:/app/public/data
- ./docker/cron_tasks/daily:/etc/periodic/daily
tmpfs:
- /app/tmp/pids
environment:
<<: *common-env
RAILS_ENV: development
depends_on:
<<: *common-depends-on
autocompleted:
condition: service_started
iqdb:
condition: service_started
tty: true
autocompleted:
image: ghcr.io/e621ng/autocompleted:54b516eded7b6641d6e958b0700eb6a887502dc1
command: /app/autocompleted
environment:
SERVER_ADDR: autocompleted:8118
PG__USER: e621
PG__HOST: postgres
PG__PORT: 5432
PG__DBNAME: e621_development
PG__POOL__MAX_SIZE: 1
nginx:
image: nginx:stable-alpine
volumes:
- ./public:/app/public
- post_data:/app/public/data
- public_packs:/app/public/packs
- ./docker/default.conf.template:/etc/nginx/templates/default.conf.template
environment:
<<: *common-env
NGINX_PORT: ${EXPOSED_SERVER_PORT:-3000}
depends_on:
- autocompleted
- e621
ports:
- "${EXPOSED_SERVER_PORT:-3000}:${EXPOSED_SERVER_PORT:-3000}"
postgres:
image: postgres:15-alpine
environment:
- POSTGRES_USER=e621
- POSTGRES_DB=e621_development
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- db_data:/var/lib/postgresql/data
ports:
- "${EXPOSED_POSTGRES_PORT:-34517}:5432"
redis:
image: redis:7.0.10-alpine
command: redis-server --save 10 1 --loglevel warning
volumes:
- redis_data_v2:/data
memcached:
image: memcached:1.5.22-alpine
opensearch:
image: opensearchproject/opensearch:2.9.0
environment:
- discovery.type=single-node
- logger.level=WARN
- DISABLE_SECURITY_PLUGIN=true
- DISABLE_INSTALL_DEMO_CONFIG=true
- OPENSEARCH_JAVA_OPTS=-Xms1g -Xmx1g
volumes:
- opensearch_data:/usr/share/opensearch/data
healthcheck:
interval: 10s
timeout: 2s
test: curl "opensearch:9200/_cluster/health?wait_for_status=yellow&timeout=2s"
iqdb:
image: ghcr.io/e621ng/iqdb:d4fed9d9a51184e72d2f14d4ec461d7830bd177a
command: iqdb http 0.0.0.0 5588 /iqdb/e621_v2.db
volumes:
- iqdb_data:/iqdb
# Discord integration
discord_joiner:
image: ghcr.io/e621ng/discord_joiner:71c6abe72a93b2cfad129d1156108c93f920d880
environment:
FETCH_SECRET: abc123
URL_SECRET: super_secret_for_url_discord
JOINER_BASE_URL: http://localhost:8000
BOT_TOKEN: ${JOINER_BOT_TOKEN-}
OAUTH2_CLIENT_ID: ${JOINER_OAUTH2_CLIENT_ID-}
OAUTH2_CLIENT_SECRET: ${JOINER_OAUTH2_CLIENT_SECRET-}
GUILD_ID: ${JOINER_GUILD_ID-}
FAILED_JOIN_URL: ${JOINER_FAILED_JOIN_WEBHOOK_URL-}
ports:
- 8000:8000
volumes:
- discord_joiner_data:/opt/app/data
profiles:
- discord
# Useful for development
tests:
image: e621
environment:
<<: *common-env
RAILS_ENV: test
# Hide annoying output from libvips on corrupt files
VIPS_WARNING: "0"
volumes:
- .:/app
- ./docker/danbooru_local_config.rb:/app/config/danbooru_local_config.rb
- node_modules:/app/node_modules
depends_on:
<<: *common-depends-on
entrypoint: bundle exec rails test
profiles:
- tests
rubocop:
image: e621
volumes:
- .:/app
- rubocop_cache:/rubocop_cache
entrypoint: bundle exec rubocop --cache-root /rubocop_cache
profiles:
- rubocop
solargraph:
image: e621
entrypoint: solargraph socket -h 0.0.0.0
working_dir: ${PWD-}
volumes:
- .:${PWD-}
environment:
IGNORE_RUBOCOP_TODO: "1"
ports:
- 7658:7658
profiles:
- solargraph
volumes:
post_data:
iqdb_data:
opensearch_data:
db_data:
redis_data_v2:
node_modules:
public_packs:
public_packs_test:
rubocop_cache:
discord_joiner_data: