Commit a7d3a296 authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

Retravaille l'image Docker.

parent bd0c3525
/node_modules
/public
/Dockerfile
/.?*
*
.?*
!assets/
!bin/prezbuilder
!gulpfile.esm.js/
!lib/
!package*.json
!templates/
......@@ -34,8 +34,7 @@ docker-image:
script:
- set -x
- docker pull "${IMAGE}" || exit 0
- docker build --cache-from "node:buster-12,${IMAGE}" --tag "${IMAGE}" .
- docker run --rm "${IMAGE}" build
- docker build --cache-from "${IMAGE}" --tag "${IMAGE}" .
- bash -x bin/prezbuilder-docker build src public
- "[ -e public/index.html ]"
- docker push "${IMAGE}"
......
......@@ -41,21 +41,15 @@ RUN wget -nv -O /tmp/wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/re
&& rm /tmp/wkhtmltox.deb \
&& wkhtmltopdf --version
RUN mkdir -p /src /opt/prezbuilder
RUN mkdir -p /workdir/src /workdir/public /opt/prezbuilder
COPY --from=builder /opt/prezbuilder /opt/prezbuilder/
COPY src/ /src/
ENV SERVER_HOST=0.0.0.0 \
SERVER_PORT=3000 \
SRC=/src \
OUTPUT=/public \
WKHTMLTOPDF_BINARY=/usr/local/bin/wkhtmltopdf
RUN mkdir -p -m 0777 $OUTPUT \
&& ln -s /opt/prezbuilder/bin/prezbuilder /usr/local/bin/prezbuilder
WORKDIR /src
WORKDIR /workdir
EXPOSE 3000/tcp 35729/tcp
ENTRYPOINT ["/usr/local/bin/prezbuilder"]
ENTRYPOINT ["/opt/prezbuilder/bin/prezbuilder"]
CMD ["dev"]
......@@ -3,9 +3,9 @@ exec docker run \
--rm -t \
--init \
-u `id -u`:`id -g` \
-v `readlink -f ${2:-src}`:/src:ro \
-v `readlink -f ${3:-public}`:/public \
-v `readlink -f ${2:-src}`:/workdir/src:ro \
-v `readlink -f ${3:-public}`:/workdir/public \
-p 3000:3000/tcp \
-p 35729:35729/tcp \
"${PREZBUILDER_IMAGE:-gitlab-registry.irstea.fr/pole-is/tools/prezbuilder}:${PREZBUILDER_TAG:-master}" \
"${1:-build}" /src /public
"${1:-build}" /workdir/src /workdir/public
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment