Category : next.js

I try to build an image for a client app (nextjs app), but the build keeps failing. This is the docker file: FROM node:12.18.3 WORKDIR /app ENV PATH /app/node_modules/.bin:$PATH COPY package.json /app/ COPY package-lock.json /app/ RUN npm install COPY . /app RUN npm build # start app CMD [ "npm", "start" ] It fails on ..

Read more

I am trying to create a docker image but I am getting this error(Couldn’t find a pages directory. Please create one under the project root) in the "npm run build" step. But I have that directory in my application root folder. In my local server it is running fine and creating .next folder. My folder ..

Read more

I have a Kubernetes cluster on Digitalocean where www.example.com points to my Next.js application. This works as expected, however it serves all the assets from that same pod where my Next.js is running: https://www.example.com/_next/static/chunks/webpack-16e102404d6e7c36f3ae.js https://www.example.com/_next/static/chunks/framework-852c1b21255b4351ab3d.js and so on. Now I would like to serve these static files from a CDN instead, so I started researching ..

Read more

I’m trying to send a simple GET request from my Next.js getStaticProps function to another container which is a node backend api using docker-compose. This is my docker-compose file: version: "3" services: web: build: ./backend volumes: – ./backend:/home/node/app/ ports: – "3001:3001" frontend: build: ./frontend volumes: – ./frontend:/home/node/app/ ports: – "3000:3000" depends_on: – "web" Index.js in ..

Read more

Looking to get NextJS working with a separate express backend on Elastic Beanstalk. I’ve got everything dockerized with an NGINX reverse proxy. Locally, everything works when using getServerSideProps, but the same request returns a 500 when deployed. Client side requests work as expected. I’ve tried various updates to the config, different urls, and could only ..

Read more