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

Optimise un peu l'image Docker.

parent 7a1f5746
ARG NODE_VERSION=12
ARG DEBIAN_RELEASE=buster
FROM node:${NODE_VERSION}-${DEBIAN_RELEASE}
FROM node:${NODE_VERSION}-${DEBIAN_RELEASE} AS builder
RUN mkdir -p /opt/prezbuilder
COPY . /opt/prezbuilder/
ENV NODE_ENV=production
RUN cd /opt/prezbuilder/ \
&& rm -rf src \
&& npm install
FROM node:${NODE_VERSION}-${DEBIAN_RELEASE}-slim
RUN apt-get update -yq \
&& apt-get install -yq --no-install-recommends \
......@@ -32,15 +42,8 @@ RUN wget -nv -O /tmp/wkhtmltox.deb https://github.com/wkhtmltopdf/wkhtmltopdf/re
&& wkhtmltopdf --version
RUN mkdir -p /src /opt/prezbuilder
COPY --from=builder /opt/prezbuilder /opt/prezbuilder/
COPY src/ /src/
COPY assets/ /opt/prezbuilder/assets/
COPY lib/ /opt/prezbuilder/lib/
COPY gulpfile.esm.js package.json package-lock.json /opt/prezbuilder/
ENV NODE_ENV=production
RUN cd /opt/prezbuilder/ \
&& env NPM_CONFIG_CACHE=/tmp/.npm npm install \
&& rm -rf /tmp/.npm
ENV SERVER_HOST=0.0.0.0 \
SERVER_PORT=3000 \
......
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