Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Navishh/nextjs-dockerized

Repository files navigation

Nextjs Application with Docker


nextjs project setup (bash & npm):

  1. npx create-next-app@latest <project_name> #initialize the project
  2. npm install
  3. npm run dev

nextjs docs: https://nextjs.org/docs/app/getting-started/installation

#create 3 files named Dockerfile .dockerignore docker-compose.yml

  1. touch Dockerfile .dockerignore docker-compose.yml

  2. docker compose build

  3. docker compose up

  4. docker tag <source-image>:<source-tag> <dockerhub-username><target-image>:<target-tag>

    • example: docker tag dn_img1/dockerized-nextjs:latest navish123/dockerized-nextjs:latest
  5. docker push <dockerhub-username><target-image>:<target-tag>

    • example: docker push navish123/dockerized-nextjs:latest
  6. docker run -p 3000:3000 navish123/dockerized-nextjs:latest

    #use the image by following the format

    • docker run -p port_no:port_no <dockerhub-username><target-image>:<target-tag>

share w your peers to see the progress w Livecycle

Github repository link:nextjs-dockerized github repo link

Medium link: https://medium.com/@itsuki.enjoy/dockerize-a-next-js-app-4b03021e084d

Livecycle link: livecycle link

About

Dockerizing a simple NextJs application

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /