Deployment via docker
I'm going to deploy a nuxt application + a custom server in dotnet via docker and docker compose on my homelab.
That will be for my dev deployment while the production deployment will happen via Azure.
In the deployment section of nuxt I cannot see anything about docker deployment specifically so I guess it is just a normal node js image and run nuxt build and then run it?
2 Replies
Hi @LordGhandi. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, you are correct: deploying a Nuxt application with Docker is a common approach, and the official Nuxt documentation provides guidance for this scenario. The typical process involves using a Node.js Docker image, running the build command (such as pnpm run build, yarn build, or npm run build), and then running the production server using the generated output.
Here’s a standard example Dockerfile for Nuxt (using Node.js and pnpm, but you can adapt it for npm or yarn):
This approach is confirmed in the Nuxt Content documentation, which describes how to build and run your Nuxt app in a Docker container. You only need to copy the .output directory from the build stage to the production image and run the server entrypoint as shown above. You can use this pattern alongside your custom .NET server in a docker-compose setup for your homelab or dev environment. For production on Azure, you can use a similar approach or leverage Azure-specific deployment options as needed Deploy with Docker.
If you use a different package manager (npm or yarn), just adjust the install and build commands accordingly.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@358749735323959308> Kapa.ai is still learning and improving, please let me know how I did by reacting below.