File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change 1- FROM node:18-slim AS base
1+ FROM node:18-alpine AS base
22ENV PNPM_HOME="/pnpm"
33ENV PATH="$PNPM_HOME:$PATH"
44RUN corepack enable
55
66FROM base AS build
7- COPY . /app
87WORKDIR /app
9-
10- RUN apt-get update && rm -rf /var/lib/apt/lists/*
11-
12- # Install dependencies
8+ COPY . .
9+ COPY package.json pnpm-lock.yaml ./
1310RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
14-
15- # Deploy only the dokploy app
1611ENV NODE_ENV=production
1712RUN pnpm run build
1813
19- # Ensure /prod/dist exists
20- RUN mkdir -p /prod/dist && cp -R /app/dist /prod/dist
21-
2214FROM base AS dokploy
2315WORKDIR /app
24-
25- # Set production
2616ENV NODE_ENV=production
2717
2818# Copy only the necessary files
29- COPY --from=build /prod /dist ./dist
19+ COPY --from=build /app /dist ./dist
3020COPY --from=build /app/package.json ./package.json
3121COPY --from=build /app/node_modules ./node_modules
3222
33- CMD HOSTNAME=0.0.0.0 && pnpm start
23+ EXPOSE 3000
24+ CMD ["pnpm" , "start" ]
You can’t perform that action at this time.
0 commit comments