2026-06-15 09:37:43 +02:00
|
|
|
FROM node:20-alpine
|
2026-06-15 09:28:22 +02:00
|
|
|
|
2026-06-18 09:38:05 +02:00
|
|
|
RUN apk add --no-cache openssl ca-certificates curl
|
2026-06-15 09:28:22 +02:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-06-15 09:37:43 +02:00
|
|
|
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs
|
2026-06-15 09:28:22 +02:00
|
|
|
|
2026-06-15 09:37:43 +02:00
|
|
|
# Copy standalone build (pre-built outside Docker)
|
2026-06-18 09:38:05 +02:00
|
|
|
COPY .next/standalone/falah-mobile ./
|
2026-06-15 09:37:43 +02:00
|
|
|
COPY .next/static ./.next/static
|
|
|
|
|
COPY public ./public
|
2026-06-18 09:38:05 +02:00
|
|
|
COPY prisma/schema.prisma ./prisma/schema.prisma
|
|
|
|
|
|
|
|
|
|
# Fix Turbopack's hashed Prisma client path
|
|
|
|
|
# Turbopack resolves @prisma/client to @prisma/client-<hash> but the
|
|
|
|
|
# build-time symlink points to a path that doesn't exist in Docker.
|
|
|
|
|
# We copy the existing @prisma/client to the hash name so Node.js
|
|
|
|
|
# can resolve it when the Turbopack runtime requires it.
|
|
|
|
|
RUN if [ -d ".next/node_modules/@prisma" ]; then \
|
|
|
|
|
for d in .next/node_modules/@prisma/client-*; do \
|
|
|
|
|
name=$(basename "$d"); \
|
|
|
|
|
rm -f "node_modules/@prisma/$name" 2>/dev/null; \
|
|
|
|
|
cp -r node_modules/@prisma/client "node_modules/@prisma/$name"; \
|
|
|
|
|
done; \
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
RUN mkdir -p /app/data
|
2026-06-15 09:28:22 +02:00
|
|
|
|
|
|
|
|
USER nextjs
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
2026-06-15 09:37:43 +02:00
|
|
|
ENV NODE_ENV=production
|
2026-06-18 09:38:05 +02:00
|
|
|
ENV DATABASE_URL="file:/app/data/dev.db"
|
2026-06-15 09:28:22 +02:00
|
|
|
|
|
|
|
|
CMD ["node", "server.js"]
|