updated and runned and tested
This commit is contained in:
28
ServicesApi/Dockerfile
Normal file
28
ServicesApi/Dockerfile
Normal file
@@ -0,0 +1,28 @@
|
||||
# --- Build Aşaması ---
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY backend/package*.json ./
|
||||
|
||||
RUN npm install -g npm@latest
|
||||
RUN npm ci
|
||||
|
||||
COPY backend .
|
||||
|
||||
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
|
||||
|
||||
USER node
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", "dist/main.js"]
|
||||
Reference in New Issue
Block a user