fix: remove unnecessary data copy in Dockerfile and create data directory at runtime
This commit is contained in:
+2
-2
@@ -3,7 +3,6 @@ FROM node:25-slim AS builder
|
||||
WORKDIR /app
|
||||
COPY package.json tsconfig.json drizzle.config.ts ./
|
||||
COPY src ./src
|
||||
COPY data ./data
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
RUN npm prune --omit=dev
|
||||
@@ -14,8 +13,9 @@ WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/data ./data
|
||||
COPY package.json .
|
||||
# Create data directory for runtime (will be mounted as volume)
|
||||
RUN mkdir -p /app/data && chown node:node /app/data
|
||||
USER node
|
||||
EXPOSE 3000
|
||||
CMD ["node", "dist/index.js"]
|
||||
|
||||
Reference in New Issue
Block a user