Category : next.js

NEXTJS requires env variables for build but not after. Originally using ARG but this seems more secure (ephemeral). However struggling with the documentation on multiple secrets and getting those secrets into a .env file. Any thoughts on what I’m doing wrong here? RUN –mount=type=secret,id=NEXT_PUBLIC_PROJECT_ID cat /run/secrets/NEXT_PUBLIC_PROJECT_ID >> .env.local –mount=type=secret,id=NEXT_PUBLIC_IDENTITY_API_KEY cat /run/secrets/NEXT_PUBLIC_IDENTITY_API_KEY >> .env.local –mount=type=secret,id=PRIVATE_KEY cat ..

Read more

I have a backend API written in Laravel, a frontend app written in NextJS and these are containerized with Docker using NGinx. Here is my docker-compose.yml file: version: ‘3.9’ services: # frontend nextjs app nextjs: build: ./hike-frontend container_name: nextjs volumes: – ./hike-frontend:/usr/app – /app/node_modules – /app/.next restart: always networks: – app-network # API Laravel app ..

Read more

I tried to dockerize strapi’s next.js corporate starter app. I used production optimized next.js Dockerfile from next.js offcial docs (along with strapi Dockerfile). Running docker-compose build (yml) resulted in strapi image being built and in next.js image build failure (as it was trying to access initial pages data from not-yet-existing strapi container): FetchError: request to ..

Read more

I’m trying to dockerize strapi cms corporate starter. Locally, when installed with npx, both backend/frontend communicate without a problem. When I run docker-compose build –no-cache –force-rm the Strapi container builds sucessfully, but the Next container fails with the following error: 17 476.4 info – Compiled successfully 17 476.4 info – Collecting page data… 17 482.2 ..

Read more

I’m using a Dockerfile referenced at https://nextjs.org/docs/deployment#docker-image. At the runner stage it has the following steps: COPY –from=builder /app/next.config.js ./ COPY –from=builder /app/public ./public COPY –from=builder –chown=nextjs:nodejs /app/.next ./.next COPY –from=builder /app/node_modules ./node_modules COPY –from=builder /app/package.json ./package.json Should I then also copy tailwind.config.js, postcss.config.js at the runner stage given I have them as part of ..

Read more