Self-Hosted Supabase & Nuxt
I’m planning to use Nuxt 3 with Supabase (self-hosted) as the database.
What are the best practices for setting up the development environment?
Should I use a single docker-compose.yml for both Nuxt and Supabase,
or is it better to run Supabase in Docker and start Nuxt separately with npm run dev?
2 Replies
Hi @Yuri. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the available knowledge sources, there is no explicit documentation or best practice guide specifically addressing the setup of a development environment for Nuxt 3 with a self-hosted Supabase instance. However, there are relevant patterns and Docker usage examples for Nuxt 3 that can help inform your decision.
Docker Compose for Local Development
Using a single
docker-compose.yml
file to orchestrate both your Nuxt 3 app and Supabase (along with any other dependencies like databases or mail services) is a common and practical approach for local development. This setup allows you to:
- Start/stop all services together with a single command.
- Ensure consistent networking between services (e.g., Nuxt can reach Supabase via service name).
- Easily share your development environment setup with your team.
For example, a typical docker-compose.yml
for a multi-service setup might look like this (see the structure in Dockerized nginx and vue+nuxt cannot connect to frontend server 111: Connection refused Part 2):
Alternative: Separate Processes
Running Supabase in Docker and Nuxt separately with npm run dev
is also valid, especially if you want faster hot-reloading for Nuxt or prefer to keep frontend and backend processes decoupled. This can be simpler for solo development or if your team already has established workflows.
Summary
- Single docker-compose.yml
: Recommended for consistency, easier onboarding, and managing dependencies together.
- Separate processes: Fine for flexibility or if you want to optimize frontend developer experience.
There is no strict "best" way—choose the approach that best fits your team's workflow and project needs. The knowledge sources do not provide a definitive recommendation for this specific Nuxt + Supabase scenario, but using Docker Compose for local orchestration is a well-established practice in the broader ecosystem and is demonstrated in Nuxt-related Docker examples How to run Nuxt3 with docker (docker compose) Part 1.
If you need a starting point for a Nuxt 3 Docker setup, see the example Dockerfile and Compose usage in the Nuxt documentation and Stack Overflow discussions How to run Nuxt3 with docker (docker compose) Part 1, Dockerized nginx and vue+nuxt cannot connect to frontend server 111: Connection refused Part 2.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@740173469404364872> Kapa.ai is still learning and improving, please let me know how I did by reacting below.