Fix docker-compose: use local registry, named volumes, run as root

This commit is contained in:
Karol Głowacki
2026-01-09 20:19:59 +01:00
parent 7abc9eba19
commit 922deef367
3 changed files with 38 additions and 5 deletions

View File

@@ -34,6 +34,9 @@ RUN adduser --system --uid 1001 nextjs
# Copy necessary files
COPY --from=builder /app/public ./public
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/prisma.config.ts ./prisma.config.ts
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json
# Set the correct permission for prerender cache
RUN mkdir .next
@@ -43,9 +46,13 @@ RUN chown nextjs:nodejs .next
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Copy entrypoint script
COPY --chown=nextjs:nodejs docker-entrypoint.sh ./
RUN chmod +x docker-entrypoint.sh
# Create upload and data directories
RUN mkdir -p uploads data
RUN chown -R nextjs:nodejs uploads data
RUN chown -R nextjs:nodejs uploads data prisma
USER nextjs
@@ -54,4 +61,6 @@ EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]
CMD ["./docker-entrypoint.sh"]