fix: auto-fix data/history write permissions in Docker entrypoint
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+6
-2
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user