forked from danbooru/danbooru
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
101 lines (93 loc) · 3 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# A Docker Compose file that launches a minimal Danbooru instance. This is
# suitable as a quick demo or for personal use, not for public-facing sites.
#
# This will start a Danbooru instance running on http://localhost:3000.
#
# Usage:
#
# docker-compose up
# docker-compose down
#
# References:
#
# * https://docs.docker.com/get-docker/
# * https://docs.docker.com/compose/install/
# * https://docs.docker.com/compose/compose-file/compose-versioning
# * https://docs.docker.com/compose/release-notes
# Version 3.4 is the latest version that is supported by the version of Docker
# Compose shipped with Ubuntu 18.04 LTS (version 1.17.4).
version: "3.4"
services:
danbooru:
user: root
image: ghcr.io/danbooru/danbooru:production
ports:
- "3000:3000"
environment:
- RAILS_ENV=production
- RAILS_SERVE_STATIC_FILES=true
- PUMA_WORKERS=1
- DATABASE_URL=postgresql://danbooru@postgres/danbooru
- DANBOORU_REDIS_URL=redis://redis:6379
- DANBOORU_IQDB_URL=http://iqdb:5588
- DANBOORU_CANONICAL_URL=http://localhost:3000
volumes:
- "danbooru-images:/danbooru/public/data"
tmpfs:
- /tmp
depends_on:
- postgres
command: ["bash", "-c", "bin/rails db:prepare && bin/rails db:seed && bin/rails server -b 0.0.0.0"]
cron:
user: root
image: ghcr.io/danbooru/danbooru:production
environment:
- RAILS_ENV=production
- DATABASE_URL=postgresql://danbooru@postgres/danbooru
- DANBOORU_REDIS_URL=redis://redis:6379
- DANBOORU_IQDB_URL=http://iqdb:5588
- DANBOORU_CANONICAL_URL=http://localhost
depends_on:
- danbooru
volumes:
- "danbooru-images:/danbooru/public/data"
command: ["bash", "-c", "bin/wait-for-http http://danbooru:3000 5s && bin/rails danbooru:cron"]
jobs:
# We need root to write temp upload files in the images directory (/danbooru/public/data)
user: root
image: ghcr.io/danbooru/danbooru:production
environment:
- RAILS_ENV=production
- DATABASE_URL=postgresql://danbooru@postgres/danbooru
- DANBOORU_REDIS_URL=redis://redis:6379
- DANBOORU_IQDB_URL=http://iqdb:5588
- DANBOORU_CANONICAL_URL=http://localhost
depends_on:
- danbooru
volumes:
# We need access to images so we can add/remove images to IQDB.
- "danbooru-images:/danbooru/public/data"
command: ["bash", "-c", "bin/wait-for-http http://danbooru:3000 5s && bin/good_job start"]
# https://github.com/danbooru/iqdb
# https://hub.docker.com/repository/docker/evazion/iqdb
iqdb:
image: evazion/iqdb
volumes:
- "iqdb-data:/iqdb/data"
command: ["http", "0.0.0.0", "5588", "/iqdb/data/iqdb.sqlite"]
redis:
image: redis
postgres:
image: evazion/postgres
environment:
POSTGRES_USER: danbooru
POSTGRES_HOST_AUTH_METHOD: trust
volumes:
- "danbooru-data:/var/lib/postgresql/data"
volumes:
danbooru-images:
name: danbooru-images
danbooru-data:
name: danbooru-data
iqdb-data:
name: iqdb-data