docker: update docker-compose file.

* Listen on port 3000 instead of port 80. Port 80 is prone to conflicts
  with other webservers.

* Use the production version of the Danbooru Docker image. It's less
  likely to have bugs than master.

* Fix the autoinstall script to work with `curl ... | sh`.

* Lower PUMA_WORKERS to 1 to reduce memory usage.
This commit is contained in:
evazion
2021-09-24 08:07:47 -05:00
parent 463e6d7b49
commit c183237b6b
3 changed files with 17 additions and 19 deletions

View File

@@ -1,7 +1,7 @@
# 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.
# This will start a Danbooru instance running on http://localhost:3000.
#
# Usage:
#
@@ -22,28 +22,28 @@ version: "3.4"
services:
danbooru:
user: root
image: ghcr.io/danbooru/danbooru
image: ghcr.io/danbooru/danbooru:production
ports:
- "80:3000"
- "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
- DANBOORU_CANONICAL_URL=http://localhost:3000
volumes:
- "danbooru-images:/danbooru/public/data"
tmpfs:
- /tmp
depends_on:
- postgres
command: ["bash", "-c", "bin/rails db:setup; bin/rails db:migrate && bin/rails server -b 0.0.0.0"]
user: root
command: ["bash", "-c", "bin/rails db:prepare && bin/rails server -b 0.0.0.0"]
cron:
user: root
image: ghcr.io/danbooru/danbooru
image: ghcr.io/danbooru/danbooru:production
environment:
- RAILS_ENV=production
- DATABASE_URL=postgresql://danbooru@postgres/danbooru
@@ -59,7 +59,7 @@ services:
delayed_jobs:
# We need root to write temp upload files in the images directory (/danbooru/public/data)
user: root
image: ghcr.io/danbooru/danbooru
image: ghcr.io/danbooru/danbooru:production
environment:
- RAILS_ENV=production
- DATABASE_URL=postgresql://danbooru@postgres/danbooru