Comments (6)
I have the same issue
Next 14.2.3
.next folder in docker only includes these files and folders
cache
prerender-manifest.js
package.json
routes-manifest.json
from next.js.
I can't see what it includes cuz it's crashing due to that build error above.
from next.js.
@devhik0 You can ssh into the image by running docker run --rm -it myimage:latest sh
(replace myimage:latest with your tag)
I do notice that it does work when I build the image in Github actions on ubuntu latest. When i'm building it on Mac m1 with --platform=linux/amd64
it doesnt create all files in .next
from next.js.
@tpdewolf Yes, but it's giving same error when I run container and stopping. Weird one, same app is running in GitHub actions machine on Ubuntu, but crashing on Windows. I tried building locally via Dockerfile, but when I run it crashed again cuz of same error.
from next.js.
hey,
almost the same for me:
- I use Next.js 14.2.3.
- The docker image run correctly on my local env but it gets stuck when i run the image on a ubuntu server.
- I build my image FROM node:20-slim
from next.js.
So, update: Check your Dockerfile and other files to make sure its copying all files and have right permissions.
Here i ll share what i changed and how it fixed everything.
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1 as base
WORKDIR /app
# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lockb /temp/dev/
RUN cd /temp/dev && bun install
# install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod
COPY package.json bun.lockb /temp/prod/
RUN cd /temp/prod && bun install --production
# copy node_modules from temp directory
# then copy all (non-ignored) project files into the image
FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED 1
# RUN bun run test #todo: add here after adding tests
RUN bun run build
# copy production dependencies and source code into final image
FROM base AS release
WORKDIR /app
# Set correct permissions for nextjs user and don't run as root
RUN adduser crm
RUN chown crm:bun .
USER crm
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease --chown=crm:bun /app/.next ./.next
COPY --from=prerelease /app/node_modules ./node_modules
COPY --from=prerelease /app/package.json ./package.json
COPY --from=prerelease /app/public ./public
CMD ["bun", "run", "build"]
# run the app
EXPOSE 3000/tcp
CMD ["bun", "start" ]
If needs use it as reference
from next.js.
Related Issues (20)
- Please stop auto closing bugs like #50388! Don't put all the burden on reporters HOT 1
- Fast Refresh Failing to Work on New Project HOT 3
- NextJS 14 HMR Tailwind CSS reloading not working HOT 3
- app router - dynamic twitter card image generator file does not return anything if returned div has style: justifyContent: "end". HOT 4
- Docs: Misleading and potentially vulnerable example code of getting client's IP address HOT 4
- Error name is always overridden with "Error" HOT 1
- Problem with postcss transformation when importing css with layer HOT 1
- ReactRemoveProperties dosen't work as it was
- Turbopack dev server and HMR consuming too much memory and freezing at code changes.
- TypeError: Failed to parse URL from /api/images HOT 7
- Vercel + pages router + basePath + middleware - Full roundtrip when client navigating to index page HOT 2
- Refractor languages missing when Turbopack is enabled
- "trailingSlash" causing CORS errors HOT 1
- Version 15 breaks select form element
- Docs: Versioned Documentation HOT 3
- Docs: inaccuracy in React Foundations (Chapter 4) HOT 3
- Sitemap is being generated incorrectly and an error in development also appears when I try to access /sitemap.xml HOT 5
- Cannot use Sharp in v15.0.0-canary.1 HOT 4
- NextJS 14 returns fetch failed with UND_ERR_CONNECT_TIMEOUT error on serverless function HOT 20
- enable swcMinify compression exception { toString, fromString } => {fromString} HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from next.js.