46 lines
No EOL
760 B
Docker
46 lines
No EOL
760 B
Docker
FROM node:18-alpine AS build
|
|
|
|
RUN apk add --no-cache \
|
|
chromium \
|
|
nss \
|
|
freetype \
|
|
harfbuzz \
|
|
ca-certificates \
|
|
ttf-freefont
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
|
|
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
|
|
RUN npm install
|
|
|
|
COPY . /app
|
|
|
|
RUN npm run build
|
|
|
|
FROM node:18-alpine AS prod
|
|
|
|
RUN apk add --no-cache \
|
|
chromium \
|
|
nss \
|
|
freetype \
|
|
harfbuzz \
|
|
ca-certificates \
|
|
ttf-freefont
|
|
|
|
WORKDIR /app
|
|
|
|
RUN mkdir -p /app/export
|
|
|
|
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
|
|
|
|
COPY --from=build /app/src/templates /app/src/templates
|
|
COPY --from=build /app/dist /app/dist
|
|
COPY --from=build /app/node_modules /app/node_modules
|
|
COPY --from=build /app/package.json /app/package.json
|
|
|
|
EXPOSE 5000
|
|
|
|
CMD [ "npm", "run", "start" ] |