change source of account id in prepared token to domain account id, create consumer salesInvoiceModule

This commit is contained in:
2026-03-30 13:16:36 +03:30
parent c870a43e35
commit 9cf9209daa
22 changed files with 758 additions and 142 deletions
+61
View File
@@ -0,0 +1,61 @@
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm
# Copy dependency files
COPY pnpm-lock.yaml package.json ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy source code
COPY . .
# Generate Prisma client and build the application
RUN pnpm exec prisma generate
RUN pnpm run build
# Production stage
FROM node:20-alpine
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm
# Install dumb-init for proper signal handling
RUN apk add --no-cache dumb-init
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install only production dependencies
RUN pnpm install --frozen-lockfile --prod
# Copy built application from builder
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
COPY prisma ./prisma
# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
USER nodejs
# Expose port
EXPOSE 5002
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:5002/api/v1/health', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})"
# Use dumb-init to handle signals properly
ENTRYPOINT ["dumb-init", "--"]
# Start application
CMD ["node", "dist/main.js"]