Diffy documentation
  • Features
    • 👋Welcome
    • Mask & Exclude
    • JavaScript snippets
    • HTTP headers
    • Cookies
    • CSS overrides
    • Mock content
    • Dealing with Dynamic Elements
      • Freeze Carousels / Sliders
      • Cookies Policy Popups
    • Configure project from YAML file
    • Zapier integration (JIRA, Trello, Basecamp integrations)
    • Bypass protection Cloudfront, Akamai, Incapsula
      • Bypass Akamai protection
      • Bypass Imperva Incapsula protection
    • Tags
    • Local development
      • DDEV add-on
      • Lando integration
      • Standalone docker container
      • Ngrok
  • Automation
    • 💡Overview
    • GitHub Pantheon CircleCI
    • GitHub Pantheon GitHub Actions
    • GitHub Tugboat
  • Tutorials
    • Comparison review
Powered by GitBook
On this page
  • Clone worker code
  • Set up .env file
  • Add container
  • Take screenshots from the container
  1. Features
  2. Local development

Standalone docker container

PreviousLando integrationNextNgrok

Last updated 8 months ago

If your project has its docker-compose setup, you can add Diffy's container to the mix to take screenshots from your local environment. The following few steps will allow you to do this.

Clone worker code

Clone the code from to some directory in your project where it makes sense.

Set up .env file

In the worker directory, copy .env.example to .env and edit DIFFY_API_KEY and DIFFY_PROJECT_ID variables.

The key can be generated in the , and you need to grab project ID from the URL of your project.

Add container

Add to your docker-compose.yml

    diffy:
        image: 'diffywebsite2/screenshot-worker:0.0.2'
        container_name: diffy
        command: tail -f /dev/null
        links:
            # This is link to your web server container. Can be different name.
            - webserver
        volumes:
            # Directory where you cloned worker code https://github.com/DiffyWebsite/diffy-worker
            - './diffy-worker:/diffy-worker'

Now remember to restart your container setup so the Diffy container is pulled in.

Take screenshots from the container

Now you can SSH to Diffy container (docker exec -it diffy bash) and then in the worker code you can run screenshots:

cd diffy-worker
node diffy-screenshots.js --url="https://webserver"

URL is the name of the container you linked in your docker-compose file

https://github.com/DiffyWebsite/diffy-worker
app