Next.js Docker로 배포하기

나의 재물운? 연애운은?

AI가 봐주는 내 사주팔자 - 운세박사

https://aifortunedoctor.com/

Next.js Docker로 배포하기

영리치 0 1,401 2023.02.09 16:28


https://nextjs.org/docs/deployment


990564053_AsEqcBVD_0b400afeef93c417ad0fb665b5f6e021011ce6d6.png


https://github.com/vercel/next.js/tree/canary/examples/with-docker

위에서 "Dockerfile" ".dockerignore" 다운로드 받아서 프로젝트 루트에 넣기


빌드하면 에러 날텐데

next.config.js 에 아래 구문 추가해주면 됨


/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
reactStrictMode: false,
// True일 경우 2번 렌더링 됨. 이유는 잘 모르겠음. 프로덕션에서는 2번 렌더링 되지 않음. True가 디폴트 값임. false로 수정함.
compiler: {
styledComponents: true,
},
};

module.exports = nextConfig;


docker build -t nextjs-docker .


docker run -p 3000:3000 nextjs-docker



Comments

나의 재물운? 연애운은?

AI가 봐주는 내 사주팔자 - 운세박사

https://aifortunedoctor.com/

Category
실시간 인기글
Magazine
훈남/훈녀
 
 
 
상점
Facebook Twitter GooglePlus KakaoStory NaverBand