By ReWild
Can the following setup be achieved with a single App Specification file (= single App)?
single managed PostgreSQL Cluster (PCLUSTER)
example.com is the main domain and it serves a next.js application from production it branch; it connects to api.example.com
api.example.com is Laravel API from production git branch; it connects to production database in PCLUSTER
example-staging.com is staging area; it runs next.js from staging git branch and connects to api.example-staging.com
api.example-staging.com is Laravel API from staging git branch; it connects to staging database in PCLUSTER
I am confused about how to configure the domains top level setting and routes per-instance settings to make this setup work. Please advise.
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!
@ReWild 👋
Currently all routable components in an app would need to share the same set of domains, so if you wanted your next.js app on a different domain than your API then they would have to be separate apps for now. Similarly for your staging app. This may change in the future, especially if we hear enough feedback about it.
An alternative would be to put your nextjs site on example.com and your API service on example.com/api (via the route path config), within the same app. You then also have access to bindable env variables that can be used to reference other components in your app, on the internal network or external depending on if you nextjs is deployed as a static site or service. In this model, your staging app would still be a separate app for now.
Hey there,
Quick update here, the ability to point multiple domains to different services in a single App Platform app is currently being worked on by the DigitalOcean team!
You can follow the progress (and upvote/comment to show support) here: 👉 https://ideas.digitalocean.com/app-platform/p/point-domains-to-specific-services
Keep an eye on that page for updates!
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.