-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (26 loc) · 996 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (26 loc) · 996 Bytes
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
FROM node:22-bookworm-slim AS frontend-build
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
FROM node:22-bookworm-slim AS backend-build
WORKDIR /app/backend
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
COPY backend/package*.json ./
RUN npm ci
COPY backend/ ./
RUN npm run build && npm prune --omit=dev
FROM node:22-bookworm-slim
WORKDIR /app
RUN apt-get update && apt-get install -y python3 python3-numpy ffmpeg && rm -rf /var/lib/apt/lists/*
ENV NODE_ENV=production
ENV PORT=3001
ENV SORTIFY_DB_PATH=/data/sortify.db
COPY --from=backend-build /app/backend/package*.json ./backend/
COPY --from=backend-build /app/backend/node_modules ./backend/node_modules
COPY --from=backend-build /app/backend/dist ./backend/dist
COPY --from=backend-build /app/backend/scripts ./backend/scripts
COPY --from=frontend-build /app/frontend/dist ./frontend/dist
EXPOSE 3001
CMD ["node", "backend/dist/server.js"]