Use output_dir in App Plateform


I have Nx workspace which build my Angular app inside dist/apps/{app_name}. Even if I use output_dir option inside my app spec yaml file (seen in the doc) to point to dist/apps/{app_name} the files taken are, for exemple /apps/front/index.html instead of /index.html. It seems that the default params (_static, public or dist) override the output_dir option or the default params (here dist) has priority over output_dir option.

Is there a solution to use dist/apps/{app_name} as dir for my Angular app ?

Actually my work-around is to do yarn nx build front && mkdir -p public && mv dist/apps/front/* public && rm -rf dist which is dirty.


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.

Kamal Nasser
DigitalOcean Employee
DigitalOcean Employee badge
November 11, 2020
Accepted Answer

Hi @scorsi

The output_dir option will take priority over the default behavior of checking for a few known directory names (_static, public, dist, build).

It sounds like the output_dir option isn’t being set. If you export your app spec in the UI (App -> Settings -> View App Spec), do you see it on the static site?

UPDATE (Nov 24, 2020) The control panel now supports the Output Directory option in the component settings.

To set this option properly, you will need to update your app spec via doctl or the API as it is not yet exposed via the Web UI:

  1. Install doctl
  2. List your apps and find your app’s UUID: doctl apps list
  3. Save your app’s spec to a file: doctl apps spec get APP-UUID > app.yaml
  4. Open app.yaml in a text editor and add the output_dir property.
  5. Update your app with the new spec: doctl apps update --spec app.yaml APP-UUID. This will kick off a new deployment

Let me know if that works!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

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

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel