My-Weekly-ToDo-List/Dockerfile
mARTin f0672e5c68 feat: fix Docker deployment, OAuth redirects, event editing, and UI improvements
- Fix Docker build: resolve hooks-rules-of-hooks in GridTaskBlock, add Suspense
  boundary for useSearchParams, fix non-root user home dir and prisma binary path
- Add comprehensive DB migrations for missing columns/tables (WeeklyGoal,
  CachedCalendarEvent, User settings, SomedayList sync fields, Task subtasks)
- Fix Outlook OAuth redirect using NEXTAUTH_URL instead of request.url
- Fix CalendarEventModal preserving existing event dates (support flat format)
- Fix header z-index layering so goal text doesn't block hover controls
- Convert font size selects to free-form text inputs, add dayHeaderGap setting
- Add goal 2-line clamping with 500px max width
- Fix weekend colors not applying to date elements

v1.6.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 23:18:13 +01:00

63 lines
1.7 KiB
Docker

# ---- Build stage ----
FROM node:18-slim AS builder
WORKDIR /app
# Install OpenSSL for Prisma
RUN apt-get update && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
COPY package*.json ./
RUN npm ci
COPY . .
# Generate Prisma client
RUN npx prisma generate
# Build the Next.js application
RUN npm run build
# ---- Production stage ----
FROM node:18-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
# Install OpenSSL for Prisma and curl for healthcheck
RUN apt-get update && apt-get install -y openssl curl && rm -rf /var/lib/apt/lists/*
# Create non-root user with a writable home directory
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 --home /home/nextjs nextjs
# Set correct permissions
RUN mkdir -p /app/logs && chown -R nextjs:nodejs /app
# Copy built output
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder /app/prisma ./prisma
# Copy Prisma CLI and generated client from builder so npx doesn't re-download
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
COPY --from=builder /app/node_modules/prisma ./node_modules/prisma
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma
# Copy entrypoint script
COPY scripts/docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
USER nextjs
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD curl -f http://localhost:3000/api/auth/session || exit 1
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["node", "server.js"]