Statamic on Digital Ocean App Platform

Oct 7, 2020

Digital Ocean released their App Platform the other day. It's similar to Heroku, which has been around for forever, but I never really got along with how Heroku works and have always really liked Digital Ocean's guides/documentation/shark loading animations, so thought I'd see what it's about.

I decided to try this site but as a full-fledged Statamic site, not the statically generated version you're looking at currently, hosted on Netlify. It was pretty easy, Digital Ocean has a sample repo for Laravel, but if you point it at a Statamic repo in Github you get all of the same settings. After that it was just adding some environmental variables, and letting it deploy.

Am I going to use it? Probably not. It was a neat test case, but the leap from this to what Netlify provides, where all of the content for the site is cached neatly on CDNs somewhere, is more than I feel like figuring out right now. A more likely step would be to deploy just the control panel to a Digital Ocean box, then let Statamic’s Git integration kick off a Netlify build and deploy.

Here’s the important parts of the App Spec file I ended up with, if anyone else ended up here trying to figure out how to get this working, with secrets obviously obscured:

1name: bwc-statamic 2region: nyc 3services: 4- build_command: “php please stache:clear \nphp please static:clear” 5 environment_slug: php 6 envs: 7 - key: STATAMIC_LICENSE_KEY 8 scope: RUN_AND_BUILD_TIME 9 value: 1234 10 - key: APP_URL 11 scope: RUN_AND_BUILD_TIME 12 value: your-app-address-here 13 - key: APP_KEY 14 scope: RUN_AND_BUILD_TIME 15 value: 1234 16 http_port: 8080 17 routes: 18 - path: / 19 run_command: heroku-php-apache2 public/

Posted: October 2020