Useful Links:
Trying to host a gatsbyjs site using platform.sh, reading the documentation (they don't officially support Gatsby) but the offer node support.
I've figured out I need a .platform.app.yaml in the root directory, but I'm struggling to set this up - I think I need a gatsby build in here.
Here is what I have so far - example taken from https://github.com/platformsh/platformsh-example-nodejs
name: nodegatsby
type: nodejs:10
dependencies:
nodejs:
pm2: "^2.0.0"
web:
commands:
start: "PM2_HOME=$PLATFORM_APP_DIR/run pm2 start index.js --no-daemon"
#in this setup you will find your application stdout and stderr in /app/run/logs
locations:
"/public":
passthru: false
root: "public"
# Whether to allow files not matching a rule or not.
allow: true
rules:
\.(css|js|gif|jpe?g|png|ttf|eot|woff2?|otf|html|ico|svg?)$:
allow: true
^/robots\.txt$:
allow: true
mounts:
"/run": "shared:files/run"
disk: 2048
Look at point 5 of the Configuration section of the Platform Node documentation you link to.
You can use the build hook to run any build steps needed.
For anyone else, haven't tested yet but simple .platform.app.yaml config file.
name: app
type: "nodejs:10"
dependencies:
nodejs:
gatsby-cli: "^1.1.58"
disk: 2048
hooks:
build: |
gatsby build
web:
locations:
'/':
root: 'public'
index: [ 'index.html' ]
There is now an official example: Deploying GatsbyJS on Platformsh.