eBooru/docker-compose.yml
Earlopain ce871e412c
[Setup] Improve docker setup
* Reduces the image size by using alpine and cleaning up after some things
* Simplify the initial setup instructions slightly
* Access via localhost:3000 instead of e621.local
2021-11-14 14:12:51 +01:00

76 lines
1.7 KiB
YAML

version: "3"
services:
e621:
build: ./
volumes:
- .:/app
- node_modules:/app/node_modules
- public_packs:/app/public/packs
- public_packs_test:/app/public/packs-test
- post_data:/app/public/data
- gems:/home/danbooru/gems
environment:
DATABASE_URL: postgresql://postgres
RAILS_ENV: development
GEM_HOME: /home/danbooru/gems
DANBOORU_HOSTNAME: http://localhost:3000
DANBOORU_REDIS_URL: redis://redis
DANBOORU_ELASTICSEARCH_HOST: elastic
DANBOORU_MEMCACHED_SERVERS: memcached
depends_on:
- postgres
- redis
- memcached
- elastic
nginx:
image: nginx:stable-alpine
volumes:
- ./public:/app/public
- post_data:/app/public/data
- public_packs:/app/public/packs
- public_packs_test:/app/public/packs-test
- ./docker/default.conf.template:/etc/nginx/templates/default.conf.template
environment:
NGINX_HOST: localhost
NGINX_PORT: 3000
depends_on:
- e621
ports:
- "3000:3000"
postgres:
build: ./docker/postgres
environment:
- POSTGRES_USER=danbooru
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- db_data:/var/lib/postgresql/data
ports:
- "34517:5432"
redis:
image: redis:alpine
memcached:
image: memcached:alpine
elastic:
image: elasticsearch:7.14.2
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- ES_JAVA_OPTS=-Xms1g -Xmx1g
volumes:
- elastic_data:/usr/share/elasticsearch/data
volumes:
post_data:
elastic_data:
db_data:
gems:
node_modules:
public_packs:
public_packs_test: