Can you use a directory within a repository to deploy to app platfrom?

Posted March 2, 2021 120 views
GitDigitalOcean App Platform

We have existing projects, I am seriously considering app platform instead of deploying directly on droplets to simply things. However, the root of the repository contains things like Dockerfiles and docker-compose.yml files to create consistent local dev environments. The actual deployable source, is in a sub directory called ‘src’. Is there a way to tell app platform to deploy this directory specifically, ignoring all else?

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.

Submit an Answer
1 answer

Hello, this should be possible if you manually use an app spec file and set the source_dir property. You can see some examples in the monorepo sample app:

- name: api
    repo: digitalocean/sample-monorepo
    branch: main
    deploy_on_push: true
  source_dir: api
  - path: /api

Here is some more documentation on using doctl and app spec reference. Hope this helps.