* Optimize Dockerfile to minimize size of the Docker image. * Specify exact versions of important dependencies (Ruby, Node, Vips) to ensure our dependencies are up to date and locked to known versions. * Install Vips from source because the version that ships with Ubuntu is too old. * Install FFmpeg from source because otherwise using the Ubuntu package pulls in tons of video libraries we don't need, bloating the image.
46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
# 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.
|
|
#
|
|
# Usage:
|
|
#
|
|
# $ docker-compose -f config/docker/docker-compose.simple.yaml up
|
|
# $ docker-compose -f config/docker/docker-compose.simple.yaml down
|
|
|
|
version: "3.7"
|
|
services:
|
|
danbooru:
|
|
# image: evazion/danbooru
|
|
build:
|
|
context: ../..
|
|
dockerfile: config/docker/Dockerfile.danbooru
|
|
ports:
|
|
- "80:3000"
|
|
environment:
|
|
- RAILS_ENV=production
|
|
- RAILS_SERVE_STATIC_FILES=true
|
|
- DATABASE_URL=postgresql://danbooru@postgres/danbooru
|
|
- DANBOORU_CANONICAL_URL=http://localhost
|
|
volumes:
|
|
- "danbooru-images:/danbooru/public/data"
|
|
depends_on:
|
|
- postgres
|
|
command: ["bash", "-c", "bin/rails db:setup; bin/rails server -b 0.0.0.0"]
|
|
user: root
|
|
|
|
postgres:
|
|
# image: evazion/postgres
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.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
|