File tree 4 files changed +9
-5
lines changed
4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Setup
4
4
5
- Install docker and docker-compose.
5
+ Install docker and docker-compose. If you want to run the app locally, you need to install ruby 3.1.4.
6
+
7
+ Run ` bundle install ` to install the dependencies.
6
8
7
9
## Run
8
10
9
11
``` shell
10
- docker-compose up
12
+ docker-compose -f docker-compose.stack.yml up
13
+ rails s -e production
11
14
```
12
15
13
16
Original file line number Diff line number Diff line change 97
97
# Do not dump schema after migrations.
98
98
config . active_record . dump_schema_after_migration = false
99
99
100
+ config . secret_key_base = ENV [ "SECRET_KEY_BASE" ] || "1"
101
+
100
102
# Inserts middleware to perform automatic connection switching.
101
103
# The `database_selector` hash is used to pass options to the DatabaseSelector
102
104
# middleware. The `delay` is used to determine how long to wait after a write
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ services:
8
8
9
9
web :
10
10
build : .
11
- command : bundle exec rails s -p 3000
11
+ command : bundle exec rails s -p 3000 -e production
12
12
environment :
13
13
- APPSIGNAL_PUSH_API_KEY=${APPSIGNAL_PUSH_API_KEY}
14
14
ports :
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ namespace :traffic do
3
3
task :go , [ :host ] do |_t , args |
4
4
require 'faraday'
5
5
require 'nokogiri'
6
- host = ENV . fetch ( 'TRAFFIC_GENERATOR_HOST' , args [ :host ] )
6
+ host = ENV . fetch ( 'TRAFFIC_GENERATOR_HOST' , args [ :host ] || 'localhost:3000' )
7
7
sleep_time = ENV . fetch ( 'TRAFFIC_GENERATOR_SLEEP_TIME' , 1 ) . to_i
8
8
9
9
puts "Starting traffic generator for #{ host } with sleep time #{ sleep_time } "
@@ -31,7 +31,6 @@ namespace :traffic do
31
31
res = Faraday . new ( "http://#{ host } " ) . get ( url ) { }
32
32
visited_urls_count += 1
33
33
34
- # res.body.scan(URI.regexp).flatten.each do |link|
35
34
Nokogiri ::HTML ( res . body ) . css ( 'a' ) . map do |link |
36
35
collected_urls [ link [ 'href' ] ] ||= true
37
36
end
You can’t perform that action at this time.
0 commit comments