Docker - Only one route available
Unanswered
Ninhache posted this in #help-forum
NinhacheOP
Hi, i've tried to "deploy" my project locally using docker using this dockerfile :
But, i'm keep getting only 1 route available, the / one.. all the others routes arnt available and i'm keep getting :
Anyone ever see this ? 🤓
FROM node:18-alpine
WORKDIR /app
COPY package.json yarn.lock* package-lock.json* ./
# build les dépendances
RUN yarn --frozen-lockfile
# copy les sources et on build l'app
COPY . .
RUN yarn build
# run de l'app
EXPOSE 3000
ENV PORT 3000
WORKDIR /app/.next/standalone
CMD ["node", "server.js"]But, i'm keep getting only 1 route available, the / one.. all the others routes arnt available and i'm keep getting :
This site can’t be reachedThe webpage at http://localhost:3000/?login=true might be temporarily down or it may have moved permanently to a new web address.
ERR_FAILEDAnyone ever see this ? 🤓
3 Replies
@Ninhache maybe static dir is missing. actually you might want to use the official example from Vercel. I use it (bit tweaked) and it works fine.
https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
@tafutada777 <@236834751325929472> maybe static dir is missing. actually you might want to use the official example from Vercel. I use it (bit tweaked) and it works fine.
https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
NinhacheOP
i've already followed that.. i'm testing on mac btw but that should work anyways
my advise is, you might want to get into the docker container by getting the shell, then make sure that all files are placed right. then launch a Next.js from the container.