Has anyone successfully deployed a SvelteKit app?

I’m trying to deploy it with a Dockerfile but it keeps saying Failed due to unhealthy allocations. SvelteKit is a pure Node app once it’s npm run build. How do I get this up and running?

FROM node:latest AS builder 

WORKDIR /app 

COPY . . 

RUN npm ci 

ARG PUBLIC_GOOGLE_OAUTH_ID="..."
ARG PUBLIC_FULLSTORY_ID="..."
ARG DATABASE_URL="data/app.db"

RUN npm run build 

FROM node:latest AS runner 

WORKDIR /app 

COPY --from=builder /app/package*.json ./ 

RUN npm ci --production --ignore-scripts 

COPY --from=builder /app/build ./ 

EXPOSE 3000

CMD ["node", "./index.js"] 

Hey,

The first thing to check would be the logs to see what it’s not happy about. Run fly logs and see if anything shows up like “can’t find X” or “failed doing Y”. That usually will reveal why the deploy failed.

If not … next I’d check the fly.toml and see what, if any, healthchecks are set up for the app. If the vm itself is fine but those checks are failing, that could also stop the deploy completing (as it would be marked as unhealthy). Like … if it’s trying to GET / and that route returns a 500 (or non-200).

1 Like