Files
danbooru/config/docker/docker-compose.test.yaml
evazion 1a8c70f5ff config: auto generate secret key if none given.
Automatically generate a random secret key for `Danbooru.config.secret_key_base`
if no key is specified.

This so that you can run Danbooru in a Docker container with zero
configuration.

This removes support for the ~/.danbooru/secret_token file and the
SECRET_TOKEN environment variable. If you used either one of these, you
must copy the value either to DANBOORU_SECRET_KEY_BASE in .env.local, or to
`secret_key_base` in config/danbooru_local_config.rb.

   # .env.local
   DANBOORU_SECRET_KEY_BASE=<value>

   # config/danbooru_local_config.rb
   def secret_key_base
      # <value>
   end
2021-03-23 03:11:41 -05:00

47 lines
1.5 KiB
YAML

#
# Usage: docker-compose --env-file .env.test -f config/docker/docker-compose.test.yaml -p danbooru run -T danbooru
#
# Docker Compose file to create an instance of danbooru along with a test database and run the test suite.
#
# https://docs.docker.com/compose/compose-file/
#
version: '3'
services:
danbooru:
build:
context: ../..
dockerfile: config/docker/Dockerfile.danbooru
environment:
- DATABASE_URL=postgresql://danbooru:danbooru@postgres/danbooru
- ARCHIVE_DATABASE_URL=postgresql://danbooru:danbooru@postgres/danbooru
- PARALLEL_WORKERS=8 # number of parallel tests to run
- DANBOORU_AWS_SQS_ENABLED
- DANBOORU_TWITTER_API_KEY
- DANBOORU_TWITTER_API_SECRET
- DANBOORU_PIXIV_LOGIN
- DANBOORU_PIXIV_PASSWORD
- DANBOORU_NIJIE_LOGIN
- DANBOORU_NIJIE_PASSWORD
- DANBOORU_NICO_SEIGA_LOGIN
- DANBOORU_NICO_SEIGA_PASSWORD
- DANBOORU_TUMBLR_CONSUMER_KEY
- DANBOORU_DEVIANTART_CLIENT_ID
- DANBOORU_DEVIANTART_CLIENT_SECRET
- DANBOORU_PAWOO_CLIENT_ID
- DANBOORU_PAWOO_CLIENT_SECRET
- DANBOORU_RAKISMET_KEY
- DANBOORU_RAKISMET_URL
- DANBOORU_IP_REGISTRY_API_KEY
depends_on:
- postgres
user: root
entrypoint: ["bash", "-c", "apt-get -y install build-essential ruby-dev zlib1g-dev postgresql-server-dev-all git && config/docker/prepare-tests.sh && bin/rails test"]
postgres:
build:
context: .
dockerfile: Dockerfile.postgres
environment:
POSTGRES_USER: danbooru
POSTGRES_PASSWORD: danbooru