Files
url_tracker_tool/apps/worker/Dockerfile.prod
Andrei 58f8093689 Rebrand from 'Redirect Intelligence v2' to 'URL Tracker Tool V2' throughout UI
- Updated all component headers and documentation
- Changed navbar and footer branding
- Updated homepage hero badge
- Modified page title in index.html
- Simplified footer text to 'Built with ❤️'
- Consistent V2 capitalization across all references
2025-08-19 19:12:23 +00:00

62 lines
1.8 KiB
Docker

# Production Dockerfile for Background Worker
FROM node:18-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY apps/worker/package*.json ./apps/worker/
COPY packages/database/package*.json ./packages/database/
COPY packages/shared/package*.json ./packages/shared/
# Install dependencies
RUN npm ci --only=production
# Copy source code
COPY apps/worker/ ./apps/worker/
COPY packages/database/ ./packages/database/
COPY packages/shared/ ./packages/shared/
COPY turbo.json ./
# Build the application
RUN npm run build
# Production stage
FROM node:18-alpine
# Install dumb-init for proper signal handling
RUN apk add --no-cache dumb-init
# Create app user
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001
# Set working directory
WORKDIR /app
# Copy package files and install production dependencies only
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/apps/worker/package*.json ./apps/worker/
COPY --from=builder /app/packages/database/package*.json ./packages/database/
COPY --from=builder /app/packages/shared/package*.json ./packages/shared/
# Install production dependencies
RUN npm ci --only=production && npm cache clean --force
# Copy built application
COPY --from=builder --chown=nextjs:nodejs /app/apps/worker/dist ./apps/worker/dist
COPY --from=builder --chown=nextjs:nodejs /app/packages/database/dist ./packages/database/dist
COPY --from=builder --chown=nextjs:nodejs /app/packages/shared/dist ./packages/shared/dist
COPY --from=builder --chown=nextjs:nodejs /app/packages/database/prisma ./packages/database/prisma
# Switch to non-root user
USER nextjs
# Set environment
ENV NODE_ENV=production
# Start the application with dumb-init
ENTRYPOINT ["dumb-init", "--"]
CMD ["node", "apps/worker/dist/index.js"]