2
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2025-12-21 21:33:02 +01:00

update splash

This commit is contained in:
kev
2019-12-09 19:38:42 +08:00
parent 166d29e501
commit fc1f9eb96d
3 changed files with 17 additions and 56 deletions

View File

@@ -10,26 +10,20 @@ It's fast, lightweight and state-less which makes it easy to distribute.
## docker-compose.yml ## docker-compose.yml
```yaml ```yaml
version: '2' version: '3.7'
services: services:
splash: splash:
image: scrapinghub/splash:3.3.1 image: scrapinghub/splash:3.4
command: --maxrss 2048 --max-timeout 300 --disable-lua-sandbox command: --maxrss 2048 --max-timeout 300 --disable-lua-sandbox --verbosity 1
ports:
- "8050:8050"
volumes: volumes:
- ./data/filters:/etc/splash/filters - ./data/filters:/etc/splash/filters
- ./data/js-profiles:/etc/splash/js-profiles - ./data/js-profiles:/etc/splash/js-profiles
- ./data/lua_modules:/etc/splash/lua_modules - ./data/lua_modules:/etc/splash/lua_modules
- ./data/proxy-profiles:/etc/splash/proxy-profiles - ./data/proxy-profiles:/etc/splash/proxy-profiles
mem_limit: 2560M
restart: unless-stopped
haproxy:
image: haproxy:alpine
ports:
- "8050:8050"
volumes:
- ./data/haproxy:/usr/local/etc/haproxy
depends_on:
- splash
restart: unless-stopped restart: unless-stopped
``` ```
@@ -42,30 +36,6 @@ File: data/filters/default.txt
||ajax.googleapis.com^ ||ajax.googleapis.com^
``` ```
File: data/haproxy/haproxy.cfg
```ini
global
maxconn 4000
defaults
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend front
bind *:8050
mode http
default_backend back
backend back
mode http
balance roundrobin
server a splash_splash_1:8050
server b splash_splash_2:8050
server c splash_splash_3:8050
```
```bash ```bash
$ cd ~/fig/splash $ cd ~/fig/splash
$ tree $ tree
@@ -75,20 +45,15 @@ $ tree
├── filters ├── filters
│   ├── easylist.txt │   ├── easylist.txt
│   └── default.txt │   └── default.txt
├── haproxy
│   └── haproxy.cfg
├── js-profiles ├── js-profiles
├── lua_modules ├── lua_modules
│   └── utils.lua │   └── utils.lua
└── proxy-profiles └── proxy-profiles
$ docker-compose up -d --scale splash=3 $ docker-compose up -d
$ docker-compose ps $ docker-compose ps
Name Command State Ports Name Command State Ports
---------------------------------------------------------------------------------- ----------------------------------------------------------------------------------
splash_haproxy_1 /docker-entrypoint.sh hapr ... Up 0.0.0.0:8050->8050/tcp
splash_splash_1 python3 /app/bin/splash -- ... Up 8050/tcp splash_splash_1 python3 /app/bin/splash -- ... Up 8050/tcp
splash_splash_2 python3 /app/bin/splash -- ... Up 8050/tcp
splash_splash_3 python3 /app/bin/splash -- ... Up 8050/tcp
``` ```
> If `default.txt` file is present in `--filters-path` folder it is used by default > If `default.txt` file is present in `--filters-path` folder it is used by default

View File

@@ -1,21 +1,15 @@
version: '2' version: '3.7'
services: services:
splash: splash:
image: scrapinghub/splash:3.3.1 image: scrapinghub/splash:3.4
command: --maxrss 2048 --max-timeout 300 --disable-lua-sandbox command: --maxrss 2048 --max-timeout 300 --disable-lua-sandbox --verbosity 1
ports:
- "8050:8050"
volumes: volumes:
- ./data/filters:/etc/splash/filters - ./data/filters:/etc/splash/filters
- ./data/js-profiles:/etc/splash/js-profiles - ./data/js-profiles:/etc/splash/js-profiles
- ./data/lua_modules:/etc/splash/lua_modules - ./data/lua_modules:/etc/splash/lua_modules
- ./data/proxy-profiles:/etc/splash/proxy-profiles - ./data/proxy-profiles:/etc/splash/proxy-profiles
mem_limit: 2560M
restart: unless-stopped
haproxy:
image: haproxy:alpine
ports:
- "8050:8050"
volumes:
- ./data/haproxy:/usr/local/etc/haproxy
depends_on:
- splash
restart: unless-stopped restart: unless-stopped

2
splash/fily Normal file
View File

@@ -0,0 +1,2 @@
log
acc