Explorar o código

Merge branch 'master' of https://github.com/gildas-lormeau/SingleFile

Former-commit-id: 09427394da5cbc15b743e61d63325a69d8993b44
Gildas %!s(int64=6) %!d(string=hai) anos
pai
achega
c78c2a5b93
Modificáronse 2 ficheiros con 27 adicións e 0 borrados
  1. 14 0
      cli/README.MD
  2. 13 0
      cli/dockerfile

+ 14 - 0
cli/README.MD

@@ -60,6 +60,20 @@ SingleFile can be launched from the command line by running it into a (headless)
 
   `single-file https://www.wikipedia.org wikipedia.html --back-end=webdriver-gecko`
   
+## Docker
+
+- Build
+
+  `docker build -t singlefile .`
+  
+- Run
+
+  `docker run singlefile "https://google.com"`
+  
+- Run and pipe the result into a file
+
+  `docker run singlefile "https://google.com" > google.html`
+
 ## License
 
 SingleFile is licensed under AGPL. Code derived from third-party projects is licensed under MIT. Please contact me at gildas.lormeau <at> gmail.com if you are interested in licensing the SingleFile code for a commercial service or product.

+ 13 - 0
cli/dockerfile

@@ -0,0 +1,13 @@
+FROM zenika/alpine-chrome:with-node
+
+RUN set -x \
+    git \
+    && git clone --recursive https://github.com/gildas-lormeau/SingleFile \
+    && cd SingleFile && npm install --production && cd cli && npm install --production \
+    && chmod +x single-file \
+    && echo
+    
+WORKDIR /usr/src/app/SingleFile/cli
+
+ENTRYPOINT ["./single-file", "--browser-executable-path", "/usr/bin/chromium-browser", "--browser-args", "[\"--no-sandbox\"]"]
+CMD ["https://github.com/Zenika/alpine-chrome"]