feature updates

This commit is contained in:
2026-02-02 16:28:53 -05:00
parent bf9aa3fa23
commit 44c06530ac
83 changed files with 282641 additions and 11251 deletions

57
server/Dockerfile Normal file
View File

@@ -0,0 +1,57 @@
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY tsconfig.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY src/ ./src/
# Generate Prisma client
RUN npx prisma generate --schema=src/db/schema.prisma
# Build TypeScript
RUN npm run build
# Production stage
FROM node:20-alpine
WORKDIR /app
# Install curl for healthcheck
RUN apk add --no-cache curl
# Copy package files and install production dependencies only
COPY package*.json ./
RUN npm ci --only=production
# Copy Prisma schema for migrations
COPY src/db/schema.prisma ./prisma/schema.prisma
# Generate Prisma client in production image
RUN npx prisma generate --schema=prisma/schema.prisma
# Copy built files
COPY --from=builder /app/dist ./dist
# Create startup script
RUN echo '#!/bin/sh' > /app/start.sh && \
echo 'npx prisma db push --schema=prisma/schema.prisma --accept-data-loss' >> /app/start.sh && \
echo 'node dist/index.js' >> /app/start.sh && \
chmod +x /app/start.sh
# Expose ports
EXPOSE 3000 3001
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:3000/health || exit 1
# Start server
CMD ["/app/start.sh"]