Lead Dev at Adfinitas
Hello,
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.
Thanks,
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!
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:
doctl apps list
doctl apps spec get APP-UUID > app.yaml
app.yaml
in a text editor and add the output_dir
property.doctl apps update --spec app.yaml APP-UUID
. This will kick off a new deploymentLet me know if that works!
Where is this Output Directory option in the component settings ?
Im needing to set the output_dir due to using symfony and thats where all my assets are served/stored so atm im getting 403 within root but app loads under https://blah.com/public
alerts:
- rule: DEPLOYMENT_FAILED
- rule: DOMAIN_FAILED
databases:
- engine: PG
name: db
version: "12"
envs:
- key: APP_ENV
scope: RUN_AND_BUILD_TIME
value: dev
features:
- buildpack-stack=ubuntu-22
ingress:
rules:
- component:
name: vectisplanner
match:
path:
prefix: /
name: vectisplanner
region: lon
services:
- build_command: |
composer update
composer install
npm run build
environment_slug: php
envs:
- key: DATABASE_URL
scope: RUN_TIME
value: ${db.DATABASE_URL}
github:
branch: main
deploy_on_push: true
repo: Wordlesschunk/VectisPlanner
http_port: 8080
instance_count: 1
instance_size_slug: basic-xs
name: vectisplanner
run_command: heroku-php-apache2
source_dir: /
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.