Skip to content

Commit

Permalink
chore(with-docker): don't copy package.json twice (#39896)
Browse files Browse the repository at this point in the history
the directory `/app/.next/standalone` already contains a copy of the package.json so we can skip copying it before we copy the standalone dir

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
boredland and ijjk committed Aug 24, 2022
1 parent 1d9706f commit 638e6d1
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 14 deletions.
2 changes: 0 additions & 2 deletions examples/with-docker-compose/next-app/prod.Dockerfile
Expand Up @@ -42,8 +42,6 @@ RUN adduser --system --uid 1001 nextjs
USER nextjs

COPY --from=builder /app/public ./public
COPY --from=builder /app/next.config.js .
COPY --from=builder /app/package.json .

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
Expand Down
3 changes: 0 additions & 3 deletions examples/with-docker-multi-env/docker/development/Dockerfile
Expand Up @@ -32,10 +32,7 @@ ENV NODE_ENV=production
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001

# You only need to copy next.config.js if you are NOT using the default configuration
# COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
Expand Down
3 changes: 0 additions & 3 deletions examples/with-docker-multi-env/docker/production/Dockerfile
Expand Up @@ -33,10 +33,7 @@ ENV NODE_ENV=production
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001

# You only need to copy next.config.js if you are NOT using the default configuration
# COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
Expand Down
3 changes: 0 additions & 3 deletions examples/with-docker-multi-env/docker/staging/Dockerfile
Expand Up @@ -33,10 +33,7 @@ ENV NODE_ENV=production
RUN addgroup -g 1001 -S nodejs
RUN adduser -S nextjs -u 1001

# You only need to copy next.config.js if you are NOT using the default configuration
# COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
Expand Down
3 changes: 0 additions & 3 deletions examples/with-docker/Dockerfile
Expand Up @@ -41,10 +41,7 @@ ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

# You only need to copy next.config.js if you are NOT using the default configuration
# COPY --from=builder /app/next.config.js ./
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
Expand Down

0 comments on commit 638e6d1

Please sign in to comment.