-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
44 lines (30 loc) · 861 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
41
42
43
44
# Stage 1: Build the application
FROM node:22-alpine AS builder
# Install FFmpeg
RUN apk add --no-cache ffmpeg
# Set working directory
WORKDIR /usr/src/app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies (including dev dependencies)
RUN npm ci
# Copy the rest of the application code
COPY . .
# Build the application
RUN npm run build
# Stage 2: Create the production image
FROM node:22-alpine
# Install FFmpeg
RUN apk add --no-cache ffmpeg
# Set working directory
WORKDIR /usr/src/app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install only production dependencies
RUN npm ci --only=production
# Copy the build artifacts from the builder stage
COPY --from=builder /usr/src/app/dist ./dist
# Expose the application port
EXPOSE 3000
# Start the application
CMD ["node", "dist/main.js"]