Skip to content

abdollah-aghayan/website-screenshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Website Screenshot

Docker-powered stateless Go API for taking screenshot from provided website

Installation

Before anything you need to have Docker and Golang installed

You can build a single container with the following command

make all

In order to increase the timeout do it as following

make all timeout="-e TIMEOUT=60"

Usage

Application will work on port 8080 so you can send a request following url

http://127.0.0.1:8080

example

http://127.0.0.1:8080/screenshot?url=http://google.com

Scaling

(this part not tested yet)

To scale the application you can use docker-compose scaling feature

docker-compose file


version: '3'

services:

  screenshot:
    image: screenshot:1.0
    environment:
      - TIMEOUT:30

  nginx:
    image: nginx:stable-alpine
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
    depends_on:
      - screenshot
    ports:
      - "8080:8080"

nginx config

user  nginx;

events {
    worker_connections   1000;
}
http {
        server {
              listen 8080;
              location / {
                proxy_pass http://localhost:8080/;
              }
        }
}

then you can do

make scale instance=the_number_of_instance

Contribution are welcome

  • write Unit as well as integration test
  • improving code base
  • improving docker file
  • adding new features
  • make documentation better

About

Docker-powered stateless Go API for taking screenshot from provided website

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published