-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (30 loc) · 1.01 KB
/
Dockerfile
File metadata and controls
34 lines (30 loc) · 1.01 KB
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
# Stage 1: Build client
FROM node:24 AS client-build
WORKDIR /app/client
COPY pnpm-workspace.yaml tsconfig.base.json ../
COPY shared ../shared
COPY client/package.json client/pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install && ls -l node_modules/vite && pnpm list vite
COPY client .
RUN pnpm run build
# Client is now in /app/client/dist
# Stage 2: Build server
FROM node:24 AS server-build
WORKDIR /app/server
COPY server/package.json ./
COPY shared ../shared
COPY pnpm-workspace.yaml tsconfig.base.json ../
RUN npm install -g pnpm && pnpm install
COPY server .
RUN pnpm run build
# Server is now in /app/server/dist
COPY --from=client-build /app/client/dist /app/server/dist/static
# Final
FROM node:24-slim
WORKDIR /app
COPY --from=server-build /app/server/dist .
ENV NODE_ENV=production
EXPOSE 3000
# Data is in /app/data, but we don't create an
# anonymous volume here to allow flexibility
CMD ["bash", "./start.sh"]