-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (30 loc) · 985 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
# Install dependencies only when needed
FROM node:18-alpine AS deps
RUN apk add --no-cache libc6-compat python3 make g++ bash
WORKDIR /app
COPY package.json yarn.lock* .yarnrc.yml ./
COPY .yarn ./.yarn
RUN yarn --immutable && mv node_modules dev_node_modules
RUN yarn workspaces focus --production
FROM node:18-alpine AS builder
WORKDIR /app
COPY --from=deps /app/dev_node_modules ./node_modules
COPY . ./
RUN yarn build
FROM node:18-alpine AS runner
RUN apk add --no-cache ffmpeg
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY src ./src
COPY scripts ./scripts
COPY .yarn ./.yarn
COPY package.json .yarnrc.yml yarn.lock* bootstrap.sh cli.sh tsconfig.json ./
COPY optimizer.config.example.js ./optimizer.config.example.js
RUN cp optimizer.config.example.js optimizer.config.js
ENV FFMPEG_PATH=/usr/bin/ffmpeg
ENV FFPROBE_PATH=/usr/bin/ffprobe
ENV NODE_ENV production
ENV PORT 3100
EXPOSE 3100
ENTRYPOINT ["./bootstrap.sh"]