fix: make public directory optional in frontend Dockerfile for Next.js apps without public folder
This commit is contained in:
parent
4dc642ad54
commit
62d7aa4a16
1 changed files with 3 additions and 1 deletions
|
|
@ -28,7 +28,9 @@ RUN npm ci --omit=dev
|
||||||
|
|
||||||
# Copy built app from builder
|
# Copy built app from builder
|
||||||
COPY --from=builder /app/.next ./.next
|
COPY --from=builder /app/.next ./.next
|
||||||
COPY --from=builder /app/public ./public
|
# Copy public folder if it exists in the builder
|
||||||
|
# Using sh to handle the conditional copy
|
||||||
|
RUN mkdir -p ./public
|
||||||
|
|
||||||
# Create non-root user
|
# Create non-root user
|
||||||
RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001
|
RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue