Question

How to use App Platform when all components are in a singe repository

Posted October 10, 2020 194 views
DigitalOcean App Platform

I have an app where the API app and front-end app are in subfolders of the project repository because I use Docker Compose when developing. When I tried to add to the App Platform, I received the error that it could not detect how to build and didn’t let me give it any guidance.

Apps Platform seems like exactly what I need for this project, but I don’t like the idea of splitting the project up into 2 repositories (would break Compose, etc.). Can I reorganize my project to make it auto-detectable, or use the App Spec YAML in way that lets me keep my project in one repository?

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.

×
1 answer

@drewsign 👋

You can do this today using doctl and a custom app spec, but we don’t expose a way to do it in the UI just yet.

We have a sample monorepo app and spec here: https://github.com/digitalocean/sample-monorepo/blob/main/.do/app.yaml — Notably, the source_dir field on component specs can be used to reference a sub-directory in your repo.

You can submit the spec using:

doctl apps create --spec .do/app.yaml

Check out the spec reference for more about what can be configured through it.

Submit an Answer