production-evyos-systems-an.../ServicesApi/Dockerfile

32 lines
566 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# --- Build Aşaması ---
FROM node:20-alpine AS builder
WORKDIR /usr/src/app
COPY ServicesApi/package*.json ./
RUN npm install -g npm@latest
RUN npm ci --legacy-peer-deps
COPY ServicesApi .
RUN npm run build
# --- Prod Image ---
FROM node:20-alpine AS production
WORKDIR /usr/src/app
ENV NODE_ENV=production
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/node_modules ./node_modules
COPY --from=builder /usr/src/app/package.json ./package.json
RUN npm prune --production
USER node
EXPOSE 3000
CMD ["node", "dist/main.js"]