Rework Dockerfile.

* 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.
This commit is contained in:
evazion
2021-03-27 00:20:15 -05:00
parent 6f6a73edd2
commit 55129b1819
3 changed files with 157 additions and 50 deletions

View File

@@ -16,14 +16,15 @@ services:
ports:
- "80:3000"
environment:
- RAILS_ENV=development
- RAILS_ENV=production
- RAILS_SERVE_STATIC_FILES=true
- DATABASE_URL=postgresql://danbooru@postgres/danbooru
- DANBOORU_CANONICAL_URL=http://localhost
volumes:
- "danbooru-images:/home/danbooru/app/public/data"
- "danbooru-images:/danbooru/public/data"
depends_on:
- postgres
entrypoint: ["bash", "-c", "bin/rails db:setup 2> /dev/null; bin/rails server -b 0.0.0.0"]
command: ["bash", "-c", "bin/rails db:setup; bin/rails server -b 0.0.0.0"]
user: root
postgres: