What am I trying to do?
Attempting to have a docker image that does following. Yes, I\'m aware there are other w
Just in case I will leave my solution here, maybe for someone, it will be helpful)
So, the idea is to run the 'selenium/standalone-chrome' image in a separate container.
First of all setup your 'docker-compose.yml' file, something like that:
version: '3.8'
services:
chrome:
image: <your_storage>/standalone-chrome
restart: always
ports:
- 4444:4444
networks:
front:
ipv4_address: 172.16.238.5
net-worker:
build: <your_storage>/<your_project>
depends_on:
- chrome
networks:
front:
ipv4_address: 172.16.238.10
networks:
front:
driver: bridge
ipam:
config:
- subnet: 172.16.238.0/24
And then in code just connect to the exist chrome instance
var options = new ChromeOptions();
options.AddArguments("--headless");
options.AddArgument("no-sandbox");
_chrome = new RemoteWebDriver(new Uri("http://172.16.238.5:4444/wd/hub"), options);
Now you can use this chrome instance for uploading your site for testing.