fix: upload permissions in Docker and improve file validation

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
orohi
2026-06-06 15:53:16 +03:00
parent 5c5aa6caec
commit 43f477ead9
4 changed files with 81 additions and 18 deletions
+5 -4
View File
@@ -1,5 +1,5 @@
FROM node:22-alpine AS base
RUN apk add --no-cache libc6-compat openssl
RUN apk add --no-cache libc6-compat openssl su-exec
WORKDIR /app
FROM base AS deps
@@ -18,7 +18,7 @@ ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs
RUN mkdir -p public/uploads && chown nextjs:nodejs public/uploads
RUN mkdir -p public/uploads
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next ./.next
@@ -26,10 +26,11 @@ COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/next.config.ts ./next.config.ts
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh && chown -R nextjs:nodejs /app
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["sh", "-c", "npx prisma db push --skip-generate && npm start"]
ENTRYPOINT ["/docker-entrypoint.sh"]