-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (26 loc) · 839 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM node:14-alpine AS builder
# Create app directory
WORKDIR /app
# A wildcard is used to ensure both package.json AND package-lock.json are copied
COPY ./package* ./
RUN npm ci
COPY . .
RUN npm run build
RUN npm prune --production
FROM node:14-alpine as release
WORKDIR /app
# Install LibreOffice
RUN \
apk update && \
apk add --no-cache --virtual=build-deps && \
apk add --no-cache libreoffice libreoffice-base openjdk8-jre-base && \
apk add --no-cache ttf-dejavu && \
apk del --purge build-deps && \
rm -rf /var/cache/apk/* && \
rm -rf /tmp/*
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/config ./config
COPY --from=builder /app/templates ./templates
CMD ["npm", "run", "start:prod"]