ulixee/secret-agent

[Question] Headless mode and docker support

justserp opened this issue · 3 comments

I some pointers to how to use secret agent entirely in a headless mode and in a docker container. I have looked through the documentation and I cant find any reference to this

x052 commented

Use xvfb to create a virtual display in the docker container. http://elementalselenium.com/tips/38-headless

We have a Dockerfile that we haven't been using for a little while, but still lives in the monorepo. You probably should not use this directly, but you might modify it to your project or simply to use yarn or npm to install the latest SecretAgent packages:
https://github.com/ulixee/secret-agent/blob/main/Dockerfile
NOTE: if you do want to use directly, you need to use the monorepo "build:docker" yarn script

We have a permissions file to startup a "CoreServer" inside docker. If you use it this way, you would deploy your "Core" to one or more servers running your docker. You would point your "@secret-agent/client" at those Core addresses. To run that way, you can use this for reference (https://github.com/ulixee/secret-agent/blob/main/tools/docker/run-core-server.sh). You would modify this script to point at your @secret-agent/core npm package.

Does this help answer what you're looking for?

If you can get all your work done on a single server, you could also just package an entire script inside the docker and use the "secret-agent" module, which packages the Core and Client into a single package.

I have a build of the core docker images at: https://hub.docker.com/repository/docker/ctaity/secret-agent, you can use it, i generally build a new image when a new version comes out because we use separately the logic and the cores.