forked from lynxtaa/unoserver-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
62 lines (43 loc) · 1.46 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM node:18.15.0-slim as node
FROM ubuntu:22.04
COPY --from=node /usr/local/ /usr/local/
WORKDIR /app
ENV DEBIAN_FRONTEND noninteractive
# Common libraries
RUN apt-get update && \
apt-get install -y curl && \
rm -rf /var/lib/apt/lists/*
# Libreoffice
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:libreoffice/ppa && \
apt-get update && \
apt-get install -y --no-install-recommends libreoffice && \
apt-get remove -y --auto-remove software-properties-common && \
rm -rf /var/lib/apt/lists/*
# Unoserver
RUN apt-get update && \
apt-get install -y python3-pip && \
pip install unoserver && \
apt-get remove -y --auto-remove python3-pip && \
rm -rf /var/lib/apt/lists/*
RUN corepack disable && corepack enable
# Some additional MS fonts for better WMF conversion
COPY fonts/*.ttf /usr/share/fonts/
RUN fc-cache -f -v
COPY pnpm-lock.yaml package.json ./
RUN pnpm fetch
COPY . .
RUN pnpm install --offline
ARG NODE_ENV
ENV NODE_ENV=$NODE_ENV
RUN if [ "$NODE_ENV" = "production" ] ; \
then pnpm run build && rm -rf node_modules && pnpm install --prod --ignore-scripts && pnpm store prune && rm -rf ./src ; \
fi
# helper for reaping zombie processes
ARG TINI_VERSION=0.19.0
ADD https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static /tini
RUN chmod +x /tini
ENTRYPOINT [ "/tini", "--" ]
CMD [ "node", "-r", "dotenv-safe/config", "build/index.js" ]
EXPOSE 3000