Refactoring, comments & overall improvements
This commit is contained in:
60 files changed
+1106
-708
No files matched your search
+21
-28
@@ -1,6 +1,7 @@
|
||||
FROM node:18-alpine as builder
|
||||
FROM node:20-alpine as builder
|
||||
|
||||
RUN apk add --no-cache python3
|
||||
RUN apk add --no-cache curl
|
||||
RUN apk add --no-cache make
|
||||
RUN apk add --no-cache gcc
|
||||
RUN apk add --no-cache build-base
|
||||
@@ -17,35 +18,27 @@ COPY . .
|
||||
|
||||
RUN pnpm run build
|
||||
|
||||
FROM node:20-alpine
|
||||
|
||||
RUN apk update
|
||||
RUN apk add --no-cache bash
|
||||
RUN apk add --no-cache curl
|
||||
RUN apk add --no-cache ffmpeg
|
||||
RUN apk add --no-cache python3
|
||||
RUN apk add --no-cache make
|
||||
RUN apk add --no-cache gcc
|
||||
RUN apk add --no-cache build-base
|
||||
|
||||
RUN npm install -g pnpm
|
||||
|
||||
ENV NODE_ENV production
|
||||
USER node
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
RUN mkdir bin
|
||||
RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/src/app/bin/yt-dlp
|
||||
RUN chmod a+rx /usr/src/app/bin/yt-dlp
|
||||
|
||||
COPY prisma/ .
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
RUN mkdir ./dist/bin/
|
||||
RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/src/app/dist/bin/yt-dlp
|
||||
RUN chmod a+rx /usr/src/app/dist/bin/yt-dlp
|
||||
|
||||
RUN pnpm install --prod
|
||||
|
||||
RUN pnpx prisma generate
|
||||
|
||||
COPY --from=builder /usr/src/app/dist ./dist
|
||||
FROM node:20-alpine
|
||||
|
||||
CMD [ "pnpm", "start" ]
|
||||
RUN apk update
|
||||
RUN apk add --no-cache ffmpeg
|
||||
RUN apk add --no-cache python3
|
||||
|
||||
USER node
|
||||
ENV NODE_ENV production
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY package.json ./
|
||||
|
||||
COPY --from=builder /usr/src/app/node_modules ./node_modules
|
||||
COPY --from=builder /usr/src/app/dist ./
|
||||
|
||||
CMD [ "node", "./src/index.js" ]
|
||||
Reference in new issue
Block a user