[Docker] Clean up bin/setup

This commit is contained in:
Earlopain 2022-11-09 18:35:20 +01:00
parent 79fd71e1f6
commit 372cb8a1ac
No known key found for this signature in database
GPG Key ID: 6CFB948E15246897
3 changed files with 2 additions and 17 deletions

6
.gitignore vendored
View File

@ -31,12 +31,6 @@ test/reports
.idea
/public/packs
/public/packs-test
/node_modules
yarn-debug.log*
.yarn-integrity
/public/packs
/public/packs-test
/node_modules

View File

@ -21,7 +21,7 @@ To mitigate this you can install a WSL distribution and clone the project inside
1. Uncomment the `COMPOSE_PROFILES` variable if you wish to use solargraph. Doesn't work on Windows without WSL.
1. Run the following commands:
```
docker-compose run -e DANBOORU_DISABLE_THROTTLES=true -e SEED_POST_COUNT=100 e621 /app/bin/setup
docker-compose run -e SEED_POST_COUNT=100 e621 /app/bin/setup
docker-compose up
```
After running the commands once only `docker-compose up` is needed to bring up the containers.

View File

@ -13,12 +13,6 @@ FileUtils.chdir APP_ROOT do
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
# Add necessary setup steps to this file.
puts '== Installing dependencies =='
system('bundle check') || system!('bundle install -j$(nproc)')
# Install JavaScript dependencies
system('bin/yarn')
puts "\n== Copying sample files =="
unless File.exist?('config/database.yml')
FileUtils.cp 'docker/database.yml', 'config/database.yml'
@ -28,7 +22,7 @@ FileUtils.chdir APP_ROOT do
end
puts "\n== Preparing database =="
system! 'bin/rails db:prepare'
system! 'DANBOORU_DISABLE_THROTTLES=true bin/rails db:prepare'
puts "\n== Preparing search indices =="
system! 'bin/rails r Post.__elasticsearch__.create_index!'
@ -38,7 +32,4 @@ FileUtils.chdir APP_ROOT do
puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear'
puts "\n== Restarting application server =="
system! 'bin/rails restart'
end