File size: 1,356 Bytes
dc89ab8
 
258f7cd
 
 
 
 
 
 
 
dc89ab8
 
 
 
 
 
 
 
 
 
 
 
258f7cd
f1ab0d5
dc89ab8
63f9146
 
dc89ab8
 
 
 
 
 
258f7cd
f1ab0d5
 
 
 
 
 
 
63f9146
f1ab0d5
258f7cd
dc89ab8
 
 
ffb5b24
dc89ab8
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
version: "3.9"  # optional since v1.27.0
services:
  crawler:
    build:
      dockerfile: Dockerfile.python
      context: .
    command: "python3 src/main.py"
    volumes:
      - "./data:/app/data:z"

  puppet:
    build:
      dockerfile: Dockerfile.deno
      context: .
    links:
      - browserless
    environment:
      BROWSERLESS_HOST: browserless
      BROWSERLESS_PORT: 3000
      DEBUG: "puppet"
    depends_on:
      - "browserless"
    # command: "sh -c 'while echo deno; do sleep 3h; done'" # debug
    command: "deno run --allow-net --allow-env --allow-read --allow-write src/index.ts"
    volumes:
       - "./deno:/app/src:z" # for debugging
       - "./data:/app/data:z"
    #restart: unless-stopped:600
    deploy:
      restart_policy:
        condition: any
        delay: 600s
        window: 300s

  cutter:
    build:
      dockerfile: Dockerfile.python
      context: .
    depends_on:
      - "puppet"
    volumes:
      - "./python:/app/src:z" # for debugging
      - "./data:/app/data:z"

  browserless:
     image: docker.io/zenika/alpine-chrome
     entrypoint: ["sh", "-c", "while true; do chromium-browser --headless --use-gl=swiftshader --disable-software-rasterizer --disable-dev-shm-usage --no-sandbox --remote-debugging-address=0.0.0.0 --remote-debugging-port=3000; sleep 2; done"]
     ports:
       - "3000:3000"