Last active
September 15, 2023 17:00
-
-
Save apnerve/8c1e9192c74c32448d1325a137ad6ecf to your computer and use it in GitHub Desktop.
Revisions
-
apnerve revised this gist
Sep 15, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # Simpler NextJS development environment Most of my NextJS projects have the same config and settings. Only thing that changes across is the `app` folder. So, making a base nextjs docker image made sense for me Create a file called `page.js` which exports a React component -
apnerve revised this gist
Sep 15, 2023 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,4 +20,11 @@ Now run docker run -v `pwd`:/app/app -p 3000:3000 apnerve/nextjs npm run dev ``` This will run the NextJS development server accessible at `http://localhost:3000` You could also create an alias ```bash alias z="docker run -v `pwd`:/app/app -p 3000:3000 apnerve/nextjs npm run" ``` and then use `z dev` (other commands also work but won't be of much use at the moment) -
apnerve created this gist
Sep 15, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ # Simpler NextJS development environment Most of my NextJS projects have the same config and settings. Only thing that changes across is the `app` folder. So, making a base nextjs docker iamge made sense for me Create a file called `page.js` which exports a React component ```JS export default function Home() { return ( <main className="min-h-screen p-4"> <h1>Home</h1> </main> ) } ``` Now run ```bash docker run -v `pwd`:/app/app -p 3000:3000 apnerve/nextjs npm run dev ``` This will run the NextJS development server accessible at `http://localhost:3000`