-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ubuntu
28 lines (25 loc) · 965 Bytes
/
Dockerfile.ubuntu
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
# Expected size : 394Mb
FROM node:current-slim as build
WORKDIR /app
COPY package.json /app/
RUN apt update -y \
&& DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y build-essential git python \
&& npm install
COPY . /app/
RUN npm run build
FROM node:current-slim as prod
WORKDIR /app
COPY --from=build /app/dist /app
RUN apt update -y \
&& DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y ffmpeg build-essential git python\
&& npm install -g pm2 modclean \
&& npm install --only=prod \
&& modclean -r \
&& modclean -r /usr/local/lib/node_modules/pm2 \
&& npm uninstall -g modclean \
&& npm cache clear --force \
&& DEBIAN_FRONTEND=noninteractive apt purge -y build-essential git \
&& apt clean autoclean \
&& apt autoremove --yes \
&& rm -rf /root/.npm /usr/local/lib/node_modules/npm /var/lib/apt/lists/* /var/cache/apt/archives/*
CMD ["pm2-runtime", "/app/main.js"]