Skip to content

Commit f649eb0

Browse files
committed
Simplify setup
1 parent 622e1e3 commit f649eb0

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
## Setup
44

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.
68

79
## Run
810

911
```shell
10-
docker-compose up
12+
docker-compose -f docker-compose.stack.yml up
13+
rails s -e production
1114
```
1215

1316

config/environments/production.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@
9797
# Do not dump schema after migrations.
9898
config.active_record.dump_schema_after_migration = false
9999

100+
config.secret_key_base = ENV["SECRET_KEY_BASE"] || "1"
101+
100102
# Inserts middleware to perform automatic connection switching.
101103
# The `database_selector` hash is used to pass options to the DatabaseSelector
102104
# middleware. The `delay` is used to determine how long to wait after a write

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88

99
web:
1010
build: .
11-
command: bundle exec rails s -p 3000
11+
command: bundle exec rails s -p 3000 -e production
1212
environment:
1313
- APPSIGNAL_PUSH_API_KEY=${APPSIGNAL_PUSH_API_KEY}
1414
ports:

lib/tasks/traffic.rake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace :traffic do
33
task :go, [:host] do |_t, args|
44
require 'faraday'
55
require 'nokogiri'
6-
host = ENV.fetch('TRAFFIC_GENERATOR_HOST', args[:host])
6+
host = ENV.fetch('TRAFFIC_GENERATOR_HOST', args[:host] || 'localhost:3000')
77
sleep_time = ENV.fetch('TRAFFIC_GENERATOR_SLEEP_TIME', 1).to_i
88

99
puts "Starting traffic generator for #{host} with sleep time #{sleep_time}"
@@ -31,7 +31,6 @@ namespace :traffic do
3131
res = Faraday.new("http://#{host}").get(url) {}
3232
visited_urls_count += 1
3333

34-
# res.body.scan(URI.regexp).flatten.each do |link|
3534
Nokogiri::HTML(res.body).css('a').map do |link|
3635
collected_urls[link['href']] ||= true
3736
end

0 commit comments

Comments
 (0)