danbooru / danbooru

A taggable image board written in Rails.
Other
2.26k stars 416 forks source link

[docker] uploading images succeeds, broken images in browser #4872

Closed tbennett6421 closed 3 years ago

tbennett6421 commented 3 years ago

After multiple attempts to get the installation to work on debian, I tried using the docker quickstart.

Everything appears to work fine. I uploaded a couple images, but they all appear as broken links. The link to the image listed in the markup appears to be localhost. See image2

Starting danbooru-ng_postgres_1 ... done
Starting danbooru-ng_iqdb_1     ... done
Starting danbooru-ng_danbooru_1 ... done
Starting danbooru-ng_cron_1         ... done
Starting danbooru-ng_delayed_jobs_1 ... done
Attaching to danbooru-ng_redis_1, danbooru-ng_iqdb_1, danbooru-ng_postgres_1, danbooru-ng_danbooru_1, danbooru-ng_cron_1, danbooru-ng_delayed_jobs_1
cron_1          | http://danbooru:3000 not up yet; retrying in 5s
iqdb_1          | [info] Starting server...
iqdb_1          | [debug] Growing m_info array (size=0).
iqdb_1          | [info] Loaded 50001 images from /iqdb/data/iqdb.sqlite.
iqdb_1          | [info] Listening on 0.0.0.0:5588.
postgres_1      |
postgres_1      | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres_1      |
postgres_1      | 2021-09-02 01:30:20.031 UTC [1] LOG:  starting PostgreSQL 12.3 (Debian 12.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
redis_1         | 1:C 02 Sep 2021 01:30:19.619 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis_1         | 1:C 02 Sep 2021 01:30:19.619 # Redis version=6.2.5, bits=64, commit=00000000, modified=0, pid=1, just started
redis_1         | 1:C 02 Sep 2021 01:30:19.619 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
postgres_1      | 2021-09-02 01:30:20.032 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres_1      | 2021-09-02 01:30:20.032 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres_1      | 2021-09-02 01:30:20.037 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
redis_1         | 1:M 02 Sep 2021 01:30:19.620 * monotonic clock: POSIX clock_gettime
postgres_1      | 2021-09-02 01:30:20.077 UTC [28] LOG:  database system was shut down at 2021-09-02 01:27:17 UTC
postgres_1      | 2021-09-02 01:30:20.088 UTC [1] LOG:  database system is ready to accept connections
delayed_jobs_1  | http://danbooru:3000 not up yet; retrying in 5s
redis_1         | 1:M 02 Sep 2021 01:30:19.621 * Running mode=standalone, port=6379.
redis_1         | 1:M 02 Sep 2021 01:30:19.621 # Server initialized
redis_1         | 1:M 02 Sep 2021 01:30:19.621 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis_1         | 1:M 02 Sep 2021 01:30:19.621 * Loading RDB produced by version 6.2.5
redis_1         | 1:M 02 Sep 2021 01:30:19.621 * RDB age 203 seconds
redis_1         | 1:M 02 Sep 2021 01:30:19.621 * RDB memory usage when created 0.77 Mb
redis_1         | 1:M 02 Sep 2021 01:30:19.622 * DB loaded from disk: 0.000 seconds
redis_1         | 1:M 02 Sep 2021 01:30:19.622 * Ready to accept connections
postgres_1      | 2021-09-02 01:30:26.502 UTC [35] ERROR:  database "danbooru" already exists
postgres_1      | 2021-09-02 01:30:26.502 UTC [35] STATEMENT:  CREATE DATABASE "danbooru" ENCODING = 'utf8'
danbooru_1      | Database 'danbooru' already exists
danbooru_1      | rails aborted!
danbooru_1      | ActiveRecord::ProtectedEnvironmentError: You are attempting to run a destructive action against your 'production' database.
danbooru_1      | If you are sure you want to continue, run the same command with the environment variable:
danbooru_1      | DISABLE_DATABASE_ENVIRONMENT_CHECK=1
danbooru_1      |
danbooru_1      | Tasks: TOP => db:setup => db:schema:load => db:check_protected_environments
danbooru_1      | (See full trace by running task with --trace)
cron_1          | http://danbooru:3000 not up yet; retrying in 5s
delayed_jobs_1  | http://danbooru:3000 not up yet; retrying in 5s
danbooru_1      | => Booting Puma
danbooru_1      | => Rails 6.1.4.1 application starting in production
danbooru_1      | => Run `bin/rails server --help` for more startup options
danbooru_1      | /danbooru/app/logical/post_query_builder.rb:444: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
danbooru_1      | /danbooru/app/logical/post_query_builder.rb:871: warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!
cron_1          | http://danbooru:3000 not up yet; retrying in 5s
delayed_jobs_1  | http://danbooru:3000 not up yet; retrying in 5s
danbooru_1      | Puma starting in single mode...
danbooru_1      | * Puma version: 5.4.0 (ruby 2.7.1-p83) ("Super Flight")
danbooru_1      | *  Min threads: 5
danbooru_1      | *  Max threads: 5
danbooru_1      | *  Environment: production
danbooru_1      | *          PID: 231
danbooru_1      | * Listening on http://0.0.0.0:3000
danbooru_1      | Use Ctrl-C to stop
cron_1          | I, [2021-09-02T01:30:4
image1 image2
nonamethanks commented 3 years ago

Try setting the DANBOORU_CANONICAL_URL variable in the docker compose file to the correct URL.

tbennett6421 commented 3 years ago

Thanks for that, I was looking at all the docker-compose files inside of config/docker. Setting that variable worked