-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (28 loc) · 707 Bytes
/
Copy pathDockerfile
File metadata and controls
42 lines (28 loc) · 707 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
32
33
34
35
36
37
38
39
40
41
42
# Build stage
FROM node:20-alpine AS build
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app
# Install root dependencies
COPY package.json pnpm-lock.yaml* ./
RUN pnpm install --frozen-lockfile 2>/dev/null || pnpm install
# Copy source and build
COPY . .
RUN pnpm build
# Production stage
FROM node:20-alpine
WORKDIR /app
# Copy built frontend
COPY --from=build /app/dist ./dist
# Copy server
COPY --from=build /app/server ./server
# Install server dependencies
WORKDIR /app/server
RUN npm install --production
WORKDIR /app
# Create data directory
RUN mkdir -p /data
ENV NODE_ENV=production
ENV DATA_DIR=/data
ENV PORT=3001
EXPOSE 3001
CMD ["node", "server/index.js"]