fix: auto-fix data/history write permissions in Docker entrypoint

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-16 21:44:41 +08:00
parent 187b08c3e1
commit 37128dee61
3 changed files with 20 additions and 2 deletions
+6 -2
View File
@@ -22,7 +22,8 @@ ENV PORT=3130
ENV HOSTNAME=0.0.0.0
RUN addgroup --system --gid 1001 nodejs \
&& adduser --system --uid 1001 nextjs
&& adduser --system --uid 1001 nextjs \
&& apk add --no-cache su-exec
# standalone 产物
COPY --from=builder /app/.next/standalone ./
@@ -35,7 +36,10 @@ RUN mkdir -p /app/data/history \
&& chown -R nextjs:nodejs /app/data \
&& chown -R nextjs:nodejs /app
USER nextjs
COPY scripts/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
EXPOSE 3130
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["node", "server.js"]