mirror of
https://github.com/kind-0/nsecbunkerd.git
synced 2026-05-03 07:00:11 +00:00
Refactor Dockerfile for Node 18 and pnpm
Updated Dockerfile to use Node 18-alpine and streamline build process.
This commit is contained in:
parent
051f4acecc
commit
8c7648d330
40
Dockerfile
40
Dockerfile
@ -1,34 +1,28 @@
|
||||
FROM node:20.11-bullseye AS build
|
||||
FROM node:18-alpine
|
||||
|
||||
# Install pnpm
|
||||
RUN npm install -g pnpm
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files and install dependencies
|
||||
COPY package*.json ./
|
||||
RUN pnpm install
|
||||
# Copy package files
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
# Copy application files
|
||||
# Install dependencies
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Copy source
|
||||
COPY . .
|
||||
|
||||
# Generate prisma client and build the application
|
||||
# Build
|
||||
RUN pnpm run build
|
||||
|
||||
# Run prisma migrations
|
||||
RUN npx prisma generate
|
||||
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
|
||||
# Create config directory
|
||||
RUN mkdir -p /app/config
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENTRYPOINT [ "node", "./dist/index.js" ]
|
||||
CMD ["start"]
|
||||
CMD ["node", "dist/index.js"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user