avatars-api/Dockerfile

22 lines
424 B
Docker
Raw Normal View History

2024-10-04 12:23:29 -05:00
# Build stage
2024-09-26 19:00:29 -05:00
FROM node:18-alpine AS build
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
2024-10-04 12:23:29 -05:00
# Deps stage
FROM node:18-alpine AS dependencies
2024-09-26 19:00:29 -05:00
WORKDIR /app
COPY package*.json .
RUN npm ci --omit=dev
2024-10-04 12:23:29 -05:00
# Prod stage
FROM node:18-alpine AS production
WORKDIR /app
COPY package*.json .
COPY --from=build /app/dist ./dist
COPY --from=dependencies /app/node_modules ./node_modules
2024-09-26 19:00:29 -05:00
CMD ["npm", "run", "start"]