making it so docker actually builds with release vs dev versions of ndk

This commit is contained in:
rabble 2024-12-09 22:11:27 +13:00
parent 8676b36f30
commit 21d7c5724f
2 changed files with 13 additions and 18 deletions

View File

@ -1,34 +1,29 @@
FROM node:20.11-bullseye AS build
WORKDIR /app
# Copy package files and install dependencies
# Copy and install all dependencies
COPY package*.json ./
RUN npm install
# Copy application files
COPY tsconfig*.json ./
RUN npm install -g npm@latest && npm install
COPY . .
# Generate prisma client and build the application
RUN npx prisma generate
RUN npm run build
# Runtime stage
# Optional: prune dev dependencies after build
RUN npm prune --omit=dev
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
# Copy only what is needed
COPY --from=build /app/package*.json ./
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY --from=build /app/node_modules/.prisma ./node_modules/.prisma
EXPOSE 3000
ENTRYPOINT [ "node", "./dist/index.js" ]
CMD ["start"]
CMD ["start"]

View File

@ -39,7 +39,7 @@
"@fastify/view": "^8.2.0",
"@inquirer/password": "^1.1.2",
"@inquirer/prompts": "^1.2.3",
"@nostr-dev-kit/ndk": "workspace:*",
"@nostr-dev-kit/ndk": "^2.10.7",
"@prisma/client": "^5.4.1",
"@scure/base": "^1.1.1",
"@types/yargs": "^17.0.24",