-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
40 lines (25 loc) · 882 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
38
39
40
FROM node:19-alpine as build
WORKDIR /usr/src/app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm \
&& pnpm install --frozen-lockfile
COPY . .
RUN pnpm run build
FROM node:19-alpine as dependencies
WORKDIR /usr/src/app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm \
# node-linker is set to hoisted to not have symlinks
&& pnpm config set node-linker hoisted \
&& pnpm install --frozen-lockfile --prod
FROM node:19-alpine as production
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
WORKDIR /usr/src/app
# Get python3 (needed for yt-dlp)
RUN apk add --update --no-cache python3 && ln -sf python3 /usr/bin/python
COPY --from=build /usr/src/app/package.json /usr/src/app/
COPY --from=build /usr/src/app/build /usr/src/app
COPY --from=dependencies /usr/src/app/node_modules /usr/src/app/node_modules
EXPOSE 8080
CMD [ "node", "./app.js" ]