Question

Deploy from public repo with 2 different apps

Hi all,

I’ve created new app (and it’s publicly available as GitHub repo), but the problem is that creating app from GitHub repo doesnt work in my case somehow: while at Create Resource From Source Code page, selecting Github as service provider + repo name + source dir as / leads to no component detected.

In general, root dir of repo consists only of 3 elements: README, /frontend and /backend. I start frontend app (nodeJS + Svelte) via cd frontend && npm run dev (being in / dir), and backend app (Python + FastAPI, Dockerfile + Docker-compose, K8s is also used, reqs.txt available) via cd backend && docker-compose up --build (also being in / dir).

I tried setting source dir to /frontend / /backend : it helps, but detects either of apps, not both.

It seems like I’m doing something completely wrong, hence the question: how do I deploy a project, service provider of which is GitHub, with multiple apps inside?

===

If I’ve missed some tutorial covering this case - sorry for that, just drop a link :)


Submit an answer


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!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
October 14, 2024

Hey there!

Is this regarding the DigitalOcean App Platform? If so, since your frontend is a Node.js app, you’ll need to set up a separate service for it:

  1. Go to the App Platform dashboard and create a new app.
  2. When selecting the repository, choose your GitHub repo and set the source directory to /frontend.
  3. App Platform will detect it as a Node.js app. Confirm the build and deployment steps.
  4. Set your build command to:
    npm install && npm run build
    
  5. Set the run command to:
    npm start
    
  6. Proceed to deploy the frontend app.

Next, we’ll set up the backend (Python + FastAPI) as a separate service:

  1. Once the frontend is deployed, go back to your App Platform project and click Edit App.
  2. Add a new component and select GitHub repository again.
  3. This time, set the source directory to /backend.
  4. Define the HTTP request path for the backend service (e.g., /api).
  5. App Platform will detect it as a Python app. Confirm the build and deployment steps.

Make sure that the backend service is on a different route than the frontend service. For example, you can set the backend service to /api and the frontend service to /. This way, the frontend will be served from the root URL, and the backend will be served from /api. And your frontend can make API calls to the backend using the /api route prefix.

Let me know if you run into any issues or need further help with the configuration.

- Bobby

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

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

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.