38 lines
919 B
Docker
38 lines
919 B
Docker
FROM node:24-alpine AS deps
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
|
|
RUN mkdir frontend
|
|
RUN mkdir lstDocs
|
|
COPY frontend/package*.json ./frontend
|
|
COPY lstDocs/package*.json ./lstDocs
|
|
|
|
RUN npm install
|
|
RUN npm run install:front
|
|
RUN npm run install:docs
|
|
|
|
# Build the Next.js app
|
|
FROM node:24-alpine AS builder
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY --from=deps /app/frontend/node_modules ./frontend/node_modules
|
|
COPY --from=deps /app/lstDocs/node_modules ./lstDocs/node_modules
|
|
COPY . ./
|
|
RUN npm run build:app
|
|
RUN npm run build:front
|
|
RUN npm run build:docs
|
|
|
|
# Final stage
|
|
FROM node:24-alpine
|
|
WORKDIR /app
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY --from=builder /app/frontend/dist ./frontend/dist
|
|
COPY --from=builder /app/lstDocs/build ./lstDocs/build
|
|
|
|
|
|
|
|
ENV NODE_ENV=production
|
|
ENV RUNNING_IN_DOCKER=true
|
|
EXPOSE 4200
|
|
CMD ["node", "dist/main.js"] |