question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to deploy KeystoneJS if we're not a DevOps master?

See original GitHub issue

Hello,

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

image

I tried build and start on now.sh, and it doesn’t works: Task XXX is stuck in BUILDING for 2700000ms

Now.sh error

image image

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

image

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

image

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:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
raulrpearsoncommented, Mar 10, 2020

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?

1reaction
MadeByMikecommented, Jun 3, 2020

We’ve added a guide on deploying to Heroku: #2598, over time I hope we can add additional guides and tutorials.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deployed to Heroku, admin UI login suddenly stops working
Turns out it was the in-memory session store, per the docs it doesn't scale past a single process. In production, this needs to...
Read more >
Mastering Plone 6. Part 1 of 2 - YouTube
Learn how to develop custom projects with Plone 6 and the new Frontend VoltoTrainer: Philip Bauer of https://ww.starzel.
Read more >
Deploying Keystone to Heroku by ropaolle · Pull Request #2598 ...
As a new user I had some issues figuring out how to deploy Keystone to a free service. ... How to deploy KeystoneJS...
Read more >
keystonejs/keystone - Gitter
I'm trying to access the keystone admin panel but no CSS is loaded. I think this is because of an authentication issue as...
Read more >
arch-keystone - npm Package Health Analysis - Snyk
KeystoneJS is a powerful Node.js content management system and web ... now been merged into our master branch, which is currently not stable ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found