Learn how to dockerize your Next.js application with OpenTelemetry via infrastack.ai
nodejs
runtime. The edge
runtime is not supported at this time.Configure next.config.mjs
next.config.mjs
file, :Create a Dockerfile
Dockerfile
in the root of your project with the following content:base
image as the base image for the builder and runner stages. The builder
stage is used to build the application and the runner
stage is used to run the application.
Create a dockerignore file
.dockerignore
file in the root of your project with the following content:Build the Docker image
nextjs-example:latest
to your desired name and tag.Run the Docker container
Visit your application
http://localhost:3000
in your web browser.
Optional: Deploy to a cloud provider