Closed Nakilon closed 1 year ago
FROM ruby:2.7-alpine RUN gem update bundler RUN apk add build-base chromium
require "ferrum" loop do puts "loop" browser = Ferrum::Browser.new headless: true, browser_options: {"no-sandbox" => nil} browser.go_to "http://t.me/tomsk_region70" sleep 10 ensure browser&.quit end
$ docker run --rm -d -v $(pwd):/app -w /app -p 8002:8000 --name temp chromium sh -c "gem install ferrum && ruby app.rb"
$ docker exec temp ps aux | grep chrome root 41 0.1 0.0 0 0 ? Z 05:45 0:00 [chrome] <defunct> root 42 0.1 0.0 0 0 ? Z 05:45 0:00 [chrome] <defunct> root 62 3.6 0.0 0 0 ? Z 05:45 0:01 [chrome] <defunct> root 64 0.1 0.0 0 0 ? Z 05:45 0:00 [chrome] <defunct> root 71 15.8 0.0 0 0 ? Z 05:45 0:06 [chrome] <defunct> root 98 0.1 0.0 0 0 ? Z 05:45 0:00 [chrome] <defunct> root 99 0.2 0.0 0 0 ? Z 05:45 0:00 [chrome] <defunct> root 115 5.5 0.0 0 0 ? Z 05:45 0:01 [chrome] <defunct> root 118 0.1 0.0 0 0 ? Z 05:45 0:00 [chrome] <defunct> root 124 24.7 0.0 0 0 ? Z 05:45 0:06 [chrome] <defunct> root 155 0.3 0.0 0 0 ? Z 05:45 0:00 [chrome] <defunct> root 156 0.3 0.0 0 0 ? Z 05:45 0:00 [chrome] <defunct> root 173 9.6 0.0 0 0 ? Z 05:45 0:01 [chrome] <defunct> root 175 0.3 0.0 0 0 ? Z 05:45 0:00 [chrome] <defunct> root 181 44.0 0.0 0 0 ? Z 05:45 0:06 [chrome] <defunct>
Seems to be resolved by https://docs.docker.com/compose/compose-file/compose-file-v3/#init I'll close when I'm sure.