Question

How to add output_dir to app platform app

Hey guys, currently im trying to deploy a symfony app on the app platform, so far i’m able to get the application to deploy but when i got to the active webpage i get a 403, this is due to the server looking wihtin the / of my project rather than /public where my assets are, i’ve had a google and it seems all i need to do is define the root and the define the output_dir to be my built assets dir

Below is my config, i have been unable to find the correct format for this, i also seem to have also found a post somewhere in the community forms here saying there should be an output directory input field upon creating the services but am unable to see where that is.

Thanks!

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: /

the application is working if i go to https://blah.com/public


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
April 14, 2024

Hey!

What you would need to do is just extend your run_command to:

    run_command: heroku-php-apache2 public/

That way the web server will be started with the correct public directory.

I have a similar Laravel project with that exact setup:

https://github.com/thedevdojo/wave/blob/main/.do/deploy.template.yaml#L9

Hope that this helps!

Best,

Bobby

Try DigitalOcean for free

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

Sign up

Featured on Community

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