How to deploy KeystoneJS if we're not a DevOps master?
See original GitHub issueHello,
I’m a front-end developer, and I’m very dumped about KeystoneJS
for deployment in production.
I install and run KeystoneJS
locally with the starter and everything works as excepted, easy and without issue.
But now I want to deploy it online, on Netlify or Now.sh, and I just don’t understand why it’s so complicated, and the documentation is really not helpful for guys who’re not DevOps! (and I hope you want Keystone to be more accessible?)
So here are my steps, as a front-end developer (with no background with back-end stuff):
I tried the build
and start
on netlify, it doesn’t works: Build exceeded maximum allowed runtime
Netlify error
I tried build
and start
on now.sh, and it doesn’t works: Task XXX is stuck in BUILDING for 2700000ms
Now.sh error
So I tried the Docker way as in the documentation:
Dockerfile
(https://www.keystonejs.com/guides/deployment):
Dockerfile
# https://docs.docker.com/samples/library/node/
ARG NODE_VERSION=12.10.0
# https://github.com/Yelp/dumb-init/releases
ARG DUMB_INIT_VERSION=1.2.2
# Build container
FROM node:${NODE_VERSION}-alpine AS build
ARG DUMB_INIT_VERSION
WORKDIR /home/node
RUN apk add --no-cache build-base python2 yarn && \
wget -O dumb-init -q https://github.com/Yelp/dumb-init/releases/download/v${DUMB_INIT_VERSION}/dumb-init_${DUMB_INIT_VERSION}_amd64 && \
chmod +x dumb-init
ADD . /home/node
RUN yarn install && yarn build && yarn cache clean
# Runtime container
FROM node:${NODE_VERSION}-alpine
WORKDIR /home/node
COPY --from=build /home/node /home/node
EXPOSE 3000
CMD ["./dumb-init", "yarn", "start"]
And then: docker build -t my-image .
And first, the Docker image was built with success, but I had this warning about peer dependencies:
Peer dependencies warning
But when I tried to run it: docker run --rm -p 127.0.0.1:3000:3000 my-image:latest
I have this error: There are no Admin UI build artifacts. Please run keystone build before running keystone start
Keystone Error
And Voilà. I’m here with my “Keystone fatigue”, and I hope there is someone to help me, and improve the Keystone documentation about the deployment phase, because it should be easy / accessible.
Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:6 (6 by maintainers)
I’m also having a really difficult time deploying. I’m trying to do it on Heroku. I want to learn how to do it and I’m happy to contribute to the documentation. How shall we go about it?
I can think of several approaches:
Extending quickstart with deployment instructions. In that vein, why doesn’t the
keystone-app
starter build a deploy-ready project? It seems one would still need to address some of the production readiness checklist items. Most importantly, the session handling.Morphing the guides > setup section into a tutorial that covers from
yarn init
to deployment. Extra points if we find a nice way to cover different stacks/options (MongoDB, Postgres, Redis, Heroku, Digital Ocean, Docker, etc.)Adding content to the guides > deployment section. I.e. deploying on Heroku, deploying as a docker image, etc.
What do you think?
We’ve added a guide on deploying to Heroku: #2598, over time I hope we can add additional guides and tutorials.