Hi, I am using app platform for deploying a PHP application in Laravel. How to manually tell the container which PHP version to use?

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
3 answers

👋🏼 @tntstudio

You can configure the PHP version in composer.json like so:

  "require": {
    "php": "^7.2.0"

For more details please see the PHP buildpack documentation

Thanks for the fast reply. In the meanwhile I figured out that the App
platform is automatically taking my Dockerfile, which I don’t won’t because its differently configured for my local development. How can I disable this?

Hi @tntstudio,

I just noticed your second question,

If you have a Dockerfile in your repo root, it will be prioritized when creating the app via the UI. This is something we’re working on improving but here are some options in the mean time:

  1. Rename Dockerfile to e.g. Dockerfile.prod then create the app via the UI.
  2. Create the app using doctl. In your repo, run: doctl app create --spec .do/app.yaml. Since you don’t set dockerfile_path in the spec, the Dockerfile will not be used.