nsecbunkerd/Dockerfile

35 lines
618 B
Docker
Raw Permalink Normal View History

FROM node:20.11-bullseye AS build
2023-05-31 20:27:33 +02:00
WORKDIR /app
# Copy package files and install dependencies
COPY package*.json ./
RUN npm install
# Copy application files
COPY . .
2023-06-28 21:44:39 +02:00
# Generate prisma client and build the application
2023-07-06 22:58:38 +02:00
RUN npx prisma generate
2023-05-31 20:27:33 +02:00
RUN npm run build
# Runtime stage
FROM node:20.11-alpine as runtime
WORKDIR /app
RUN apk update && \
apk add --no-cache openssl && \
rm -rf /var/cache/apk/*
# Copy built files from the build stage
COPY --from=build /app .
# Install only runtime dependencies
RUN npm install --only=production
EXPOSE 3000
2023-06-28 21:44:39 +02:00
ENTRYPOINT [ "node", "./dist/index.js" ]
2023-05-31 20:27:33 +02:00
CMD ["start"]