From 1ed0d7ec41cde2fbad4fda94b58a0024bcb4e0ba Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Fri, 22 Jul 2022 22:44:08 +0200 Subject: [PATCH] improve Dockerfile and fix update reference task --- package.json | 2 +- test/Dockerfile | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index cd4697b0..c6efc49d 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "test:js": "mocha test/**_test.js", "lint": "standard lib/**.js test/**.js tasks/**js", "publish": "node tasks/publish.js", - "test:update-linux-reference": "docker build -f test/Dockerfile -t asciidoctor-web-pdf/test . && docker run --name asciidoctorwebpdftest asciidoctor-web-pdf/test:latest && docker cp asciidoctorwebpdftest:/app/test/output ./test/reference/linux/" + "test:update-linux-reference": "docker build -f test/Dockerfile -t asciidoctor-web-pdf/test . && docker run --name asciidoctorwebpdftest asciidoctor-web-pdf/test:latest; docker cp asciidoctorwebpdftest:/app/test/output/. ./test/reference/linux/ && docker rm asciidoctorwebpdftest" }, "repository": { "type": "git", diff --git a/test/Dockerfile b/test/Dockerfile index 22755998..671e798d 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -9,14 +9,14 @@ RUN apt-get update \ USER asciidoc WORKDIR /app +COPY --chown=asciidoc:asciidoc package.json package-lock.json ./ +RUN npm ci && npm cache clean --force + COPY --chown=asciidoc:asciidoc lib ./lib COPY --chown=asciidoc:asciidoc bin ./bin COPY --chown=asciidoc:asciidoc css ./css COPY --chown=asciidoc:asciidoc fonts ./fonts COPY --chown=asciidoc:asciidoc test ./test -COPY --chown=asciidoc:asciidoc package.json package-lock.json ./ -RUN npm ci - ENV DEBUG=1 CMD npm t