Some checks failed
Deploy / deploy (push) Failing after 50s
- Implemented a new HomePage component displaying the leaderboard. - Created Providers component for session management using next-auth. - Developed Header component for navigation and user authentication. - Added Leaderboard component to fetch and display sleep data. - Introduced SleepCard component for individual sleep entries. - Created SleepForm component for logging sleep data with manual input options. - Added SleepPhaseBar component to visualize sleep phases. - Implemented utility functions for formatting and calculating sleep data. - Set up authentication with Discord using next-auth and Prisma. - Configured middleware for protected routes. - Added TypeScript definitions for next-auth session. - Configured Tailwind CSS for styling. - Initialized TypeScript configuration for the project.
43 lines
1.0 KiB
Docker
43 lines
1.0 KiB
Docker
# ---- Dependencies ----
|
|
FROM node:20-alpine AS deps
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
# ---- Builder ----
|
|
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
RUN npx prisma generate
|
|
RUN npm run build
|
|
|
|
# ---- Runner ----
|
|
FROM node:20-alpine AS runner
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
|
|
RUN addgroup --system --gid 1001 nodejs
|
|
RUN adduser --system --uid 1001 nextjs
|
|
|
|
# Copy standalone 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 prisma for migrations
|
|
COPY --from=builder /app/prisma ./prisma
|
|
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
|
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma
|
|
|
|
# Entrypoint script
|
|
COPY docker-entrypoint.sh ./
|
|
RUN chmod +x docker-entrypoint.sh
|
|
|
|
USER nextjs
|
|
EXPOSE 3000
|
|
ENV PORT=3000
|
|
ENV HOSTNAME="0.0.0.0"
|
|
|
|
ENTRYPOINT ["./docker-entrypoint.sh"]
|