fix: Dockerfile builder 단계에서 public 디렉토리 보장
- builder에서 mkdir -p로 public 디렉토리 생성 (앱에 없을 경우 대비) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+4
-3
@@ -34,6 +34,9 @@ COPY . .
|
||||
RUN cd packages/database && npx prisma generate
|
||||
RUN pnpm turbo run build --filter=@relink/${APP_NAME}
|
||||
|
||||
# Ensure public directories exist for COPY
|
||||
RUN mkdir -p /app/apps/${APP_NAME}/public
|
||||
|
||||
# --- Stage 3: Runner ---
|
||||
FROM node:20-alpine AS runner
|
||||
ARG APP_NAME=web
|
||||
@@ -44,9 +47,7 @@ RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
WORKDIR /app
|
||||
|
||||
# Ensure public dir exists (some apps may not have one)
|
||||
RUN mkdir -p ./public
|
||||
COPY --from=builder /app/apps/${APP_NAME}/public/ ./public/
|
||||
COPY --from=builder /app/apps/${APP_NAME}/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/${APP_NAME}/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/apps/${APP_NAME}/.next/static ./apps/${APP_NAME}/.next/static
|
||||
|
||||
|
||||
Reference in New Issue
Block a user