Fix Docker build: switch from Alpine to Debian slim
Alpine's apk package manager fails in Coolify's build environment due to network permission issues. Debian slim's apt-get is more reliable in containerized CI/CD pipelines. Made-with: Cursor
This commit is contained in:
parent
7e423a3e50
commit
53d8e021ae
1 changed files with 7 additions and 4 deletions
11
Dockerfile
11
Dockerfile
|
|
@ -1,6 +1,9 @@
|
||||||
FROM node:18-alpine AS base
|
FROM node:18-slim AS base
|
||||||
|
|
||||||
RUN apk add --no-cache graphicsmagick ghostscript
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
graphicsmagick \
|
||||||
|
ghostscript \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
@ -21,8 +24,8 @@ WORKDIR /app
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN groupadd --system --gid 1001 nodejs
|
||||||
RUN adduser --system --uid 1001 nextjs
|
RUN useradd --system --uid 1001 nextjs
|
||||||
|
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue