I was trying out App Platform to build my Jekyll blog : http://github.com/cupnoodle/mountain_goat , it requires npm to run the Gulpfile , but App Platform auto detects my repository as Jekyll site (which is correct), but I can’t add additional nodeJS buildpack and it can’t run npm command like npm run build
.
Is it possible to add additional buildpack? Did I miss some configuration?
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.
This is possible to do today, but you’ll need to build using a Dockerfile, since we don’t yet support configuring multiple or overriding buildpacks on the App Platform.
I forked your repo and added a Dockerfile.build that looks like this:
FROM starefossen/ruby-node
ENV BUNDLER_VERSION=2.1.4
RUN gem install bundler -v ${BUNDLER_VERSION}
COPY . /app
WORKDIR /app
RUN bundle install && npm install && npm run build
We’re currently missing support in the UI for including an output_dir
field that’s required for Dockerfile-based static builds, so you’ll need to submit using doctl
and a spec YAML directly in the meantime. I added a .do/app.yaml file to the repo; you’ll want to use a similar one that looks like this:
name: mountain-goat
static_sites:
- name: site
github:
repo: cupnoodle/mountain_goat
branch: master
deploy_on_push: true
dockerfile_path: Dockerfile.build
output_dir: /app/_site
You can then create the app using doctl
with:
doctl apps create --spec .do/app.yaml
@snormoredo has there been any change to the support for multiple/custom build packs?