I struggle a little bit with running Canopy inside a docker container. So I thought it would be great to document how to achieve it in a separate post. I have following code which is responsible for downloading a whole page by going to it.
The startChrome method looks as follows:
As you may see I don’t use HeadlessChrome instead of it I use standard chrome and pass arguments to it to use a headless mode and no-sandbox. Which are needed.
That’s all from a code perspective, but I need to do some adjustments so the canopy would be run inside of a docker. To make it happen I have to do the following things:
copy chrome driver in a server.fsproj to output folder;
install chrome in a docker image.
This article in short illustrates how to run canopy inside of docker container. You could check-out my repository the get the fully working example of above.