chore(ops): harden deployment and runtime setup
This commit is contained in:
parent
1d7e7c41c9
commit
c35bd5877e
30 changed files with 534 additions and 61 deletions
16
Dockerfile
16
Dockerfile
|
|
@ -14,16 +14,22 @@ FROM node:22-alpine AS runner
|
|||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV NEXT_PUBLIC_APP_VERSION=0.2.2
|
||||
ENV DOCKER_ENV=true
|
||||
ENV PORT=3010
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/scripts/runtime-start.js ./runtime-start.js
|
||||
|
||||
RUN mkdir -p /app/data /app/public/uploads/images /app/.next/cache \
|
||||
&& chown -R nextjs:nodejs /app/data /app/public/uploads /app/.next/cache
|
||||
|
||||
USER nextjs
|
||||
EXPOSE 3010
|
||||
ENV PORT=3010
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
CMD ["node", "runtime-start.js"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue