eBooru/docker-compose.yml

190 lines
4.6 KiB
YAML
Raw Normal View History

version: "3"
2021-11-13 21:31:26 -05:00
x-environment: &common-env
DANBOORU_HOSTNAME: http://localhost:3000
DANBOORU_REDIS_URL: redis://redis
DANBOORU_ELASTICSEARCH_HOST: elastic
DANBOORU_MEMCACHED_SERVERS: memcached
2023-04-24 08:46:26 -04:00
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
SECRET_TOKEN: 1c58518a891eff4520cadc59afa9e378a9325f1247544ff258096e497f095f45
SESSION_SECRET_KEY: 44b4f44e9f253c406cbe727d403d500c1cecff943e4d2aea8f5447f28846fffe
x-depends-on: &common-depends-on
elastic:
condition: service_healthy
memcached:
condition: service_started
postgres:
condition: service_started
redis:
condition: service_started
2021-11-13 21:31:26 -05:00
services:
e621:
build:
context: ./
args:
COMPOSE_PROFILES: ${COMPOSE_PROFILES-}
image: e621
2021-11-13 21:31:26 -05:00
volumes:
- .:/app
- node_modules:/app/node_modules
2021-11-13 21:31:26 -05:00
- public_packs:/app/public/packs
- post_data:/app/public/data
- ./docker/cron_tasks/daily:/etc/periodic/daily
tmpfs:
- /app/tmp/pids
2021-11-13 21:31:26 -05:00
environment:
<<: *common-env
2021-11-13 21:31:26 -05:00
RAILS_ENV: development
depends_on:
<<: *common-depends-on
autocompleted:
condition: service_started
iqdb:
condition: service_started
tty: true
2021-11-13 21:31:26 -05:00
autocompleted:
2023-06-05 16:14:10 -04:00
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
2021-11-13 21:31:26 -05:00
nginx:
image: nginx:stable-alpine
2021-11-13 21:31:26 -05:00
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:
NGINX_HOST: localhost
NGINX_PORT: 3000
2021-11-13 21:31:26 -05:00
depends_on:
- autocompleted
2021-11-13 21:31:26 -05:00
- e621
ports:
- "3000:3000"
2021-11-13 21:31:26 -05:00
postgres:
image: postgres:15-alpine
2021-11-13 21:31:26 -05:00
environment:
- POSTGRES_USER=e621
- POSTGRES_DB=e621_development
2021-11-13 21:31:26 -05:00
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- db_data:/var/lib/postgresql/data
ports:
- "34517:5432"
redis:
2023-04-13 14:46:05 -04:00
image: redis:7.0.10-alpine
command: redis-server --save 10 1 --loglevel warning
volumes:
- redis_data_v2:/data
2021-11-13 21:31:26 -05:00
memcached:
2023-04-13 14:46:05 -04:00
image: memcached:1.5.22-alpine
2021-11-13 21:31:26 -05:00
elastic:
image: elasticsearch:7.14.2
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- logger.level=WARN
- ES_JAVA_OPTS=-Xms1g -Xmx1g
2021-11-13 21:31:26 -05:00
volumes:
- elastic_data:/usr/share/elasticsearch/data
healthcheck:
interval: 10s
timeout: 2s
test: nc -z elastic 9200
2021-11-13 21:31:26 -05:00
2023-04-24 08:46:26 -04:00
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
2023-02-25 09:14:48 -05:00
RAILS_ENV: test
# Hide annoying output from libvips on corrupt files
VIPS_WARNING: "0"
volumes:
- .:/app
2023-02-25 09:14:48 -05:00
- ./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
2021-11-13 21:31:26 -05:00
volumes:
post_data:
iqdb_data:
2021-11-13 21:31:26 -05:00
elastic_data:
db_data:
redis_data_v2:
node_modules:
2021-11-13 21:31:26 -05:00
public_packs:
public_packs_test:
rubocop_cache:
discord_joiner_data: