diff --git a/README.md b/README.md index 6f54f6d05..aa568bd91 100644 --- a/README.md +++ b/README.md @@ -2,22 +2,20 @@ ## Quickstart -Clone this repository and run `bin/danbooru` to start a basic Danbooru instance: +Run this to start a basic Danbooru instance: ```sh -git clone https://github.com/danbooru/danbooru -cd danbooru -./bin/danbooru +curl -sSL https://raw.githubusercontent.com/danbooru/danbooru/master/bin/danbooru | sh ``` This will install [Docker Compose](https://docs.docker.com/compose/) and use it -to start Danbooru. This will take several minutes and produce lots of output. -When it's done, Danbooru will be running at http://localhost. +to start Danbooru. When it's done, Danbooru will be running at http://localhost:3000. Alternatively, if you already have Docker Compose installed, you can just do: ```sh -docker-compose -f config/docker/docker-compose.simple.yaml up +wget https://raw.githubusercontent.com/danbooru/danbooru/master/docker-compose.yaml +docker-compose up ``` ## Manual Installation diff --git a/bin/danbooru b/bin/danbooru index da30426db..dc1d30021 100755 --- a/bin/danbooru +++ b/bin/danbooru @@ -1,7 +1,7 @@ -#!/usr/bin/env bash +#!/bin/sh # # This script starts Danbooru by installing Docker and Docker Compose, then -# starting Danbooru in a container. Danbooru will be available at http://localhost. +# starting Danbooru in a container. Danbooru will be available at http://localhost:3000. # # Usage: # @@ -15,11 +15,11 @@ # # This script is just a wrapper for that command. -set -euxo pipefail +set -eux # Check if program exists. has() { - type -p "$1" > /dev/null + type "$1" > /dev/null 2>&1 } # Install Docker and Docker Compose if they're not installed already. diff --git a/docker-compose.yaml b/docker-compose.yaml index 23625ae78..1ec736f4a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -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