Troubleshooting
Below are the most common deployment issues:
- Unexpected folder structure. See the squid structure for details.
- Docker build failures. Build a Docker images locally (see below) to troubleshoot.
- Database migration failures. Troubleshoot by executing the DB migration locally with a locally built image (see below).
- Outdated Squid SDK packages. Update to the latest SDK lib versions with
npm run update
.
Local Docker build
To make a dry run locally, create a local Dockerfile
with the following content:
Dockerfile
FROM node:16-alpine AS node
FROM node AS node-with-gyp
RUN apk add g++ make python3
FROM node-with-gyp AS builder
WORKDIR /squid
ADD package.json .
ADD package-lock.json .
RUN npm ci
ADD tsconfig.json .
ADD src src
RUN npm run build
FROM node-with-gyp AS deps
WORKDIR /squid
ADD package.json .
ADD package-lock.json .
RUN npm ci --production
FROM node AS squid
WORKDIR /squid
COPY /squid/package.json .
COPY /squid/package-lock.json .
COPY /squid/node_modules node_modules
COPY /squid/lib lib
RUN echo -e "loglevel=silent\\nupdate-notifier=false" > /squid/.npmrc
ADD db db
ADD assets assets
ADD schema.graphql .
Then build an image locally with
docker build . -t my-squid
and fix the squid if necessary.
Local migration run
To test the migration scripts:
- Start a fresh database:
docker compose down
docker compose up db -d
- Run
npx squid-typeorm-migration apply
with the local squid image:
docker run --rm -e DB_HOST=host.docker.internal --env-file=.env my-squid npx squid-typeorm-migration apply