- Updated app name in all source files, documentation, and configuration - Changed package names in package.json files - Updated header, titles, and user-facing text - Modified email templates and notification text - Updated steering rules and spec documents
63 lines
1.3 KiB
Docker
63 lines
1.3 KiB
Docker
# Multi-stage build for Litter Scouts frontend
|
|
FROM node:20-alpine AS frontend-builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy frontend package files
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
# Copy frontend source
|
|
COPY . .
|
|
|
|
# Build frontend
|
|
RUN npm run build
|
|
|
|
# Backend builder stage
|
|
FROM node:20-alpine AS backend-builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy backend package files
|
|
COPY server/package*.json ./
|
|
RUN npm ci
|
|
|
|
# Copy backend source and prisma
|
|
COPY server/ ./
|
|
|
|
# Generate Prisma client
|
|
RUN npx prisma generate
|
|
|
|
# Build backend
|
|
RUN npm run build
|
|
|
|
# Production stage
|
|
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Install production dependencies for backend
|
|
COPY server/package*.json ./
|
|
RUN npm ci --only=production
|
|
|
|
# Copy built backend
|
|
COPY --from=backend-builder /app/dist ./dist
|
|
COPY --from=backend-builder /app/node_modules/.prisma ./node_modules/.prisma
|
|
COPY --from=backend-builder /app/prisma ./prisma
|
|
|
|
# Copy built frontend to serve statically
|
|
COPY --from=frontend-builder /app/dist ./public
|
|
|
|
# Create uploads directory
|
|
RUN mkdir -p ./uploads
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s \
|
|
CMD node -e "require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
|
|
|
|
# Start the application
|
|
CMD ["node", "dist/index.js"]
|