Report this

What is the reason for this report?

Hosting multiple Nuxtjs apps on same domain in app platform

Posted on September 3, 2022

For a personal project i want to use app platform for hosting my nuxt 3 app.

What i am using now:

  • main domain -> example.com which is a different gitlab repo and different pipeline
  • Sub domain -> app.example.com This way i could update the container one by one and on different versions.

What i might want to use:

  • Example.com hosts my main application
  • Example.com/dashboard hosts my dashboard I know you can host multiple components in the app platform. Since i am using supabase this would be better. I dont need multiple login screens since logging in on example.com/login would also log me in on the dashboard.

Questions:

  1. With different apps in app platform i can just use doctl in gitlab pipeline and push a new update when the pipeline is finished. How is this done on component level? If i have two components how do i update them apart from each other with out forcing both components to rebuild?
  2. Can you give labels or tags to components in the YAML file?
  3. If i want to go with the second setup, is there any additional config required on the app platform to make this work beside changing the http route and port where the container is listening to?

Hope someone has the time and patience to explain this to me.

Thanks in advancce.

Greetings,

Dylan



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

What you could do is have 1 App with multiple different components.

Then for each component, you can specify a different ${PUBLIC_ROUTE_PATH} and ${PUBLIC_URL}

This allows you to have a public routable path used for the specific service, eg /dashboard, /login and etc.

That way you will have 1 App associated with your domain, but with multiple different micro services handling each specific route.

For more information, I could suggest the documentation here:

https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/

Hope that this helps.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.