Hi guys, I'm trying to create migration with prism...
# orm-help
s
Hi guys, I'm trying to create migration with prisma and I have this issue.
Copy code
Error: Unable to require(`/app/node_modules/@prisma/engines/libquery_engine-linux-musl.so.node`)
 Error loading shared library libssl.so.3: No such file or directory (needed by /app/node_modules/@prisma/engines/libquery_engine-linux-musl.so.node)
ERROR: 1
I ran the command using
docker-compose run api npx prisma migrate dev
My Dockerfile looks like this.
Copy code
FROM node:14-alpine as development
RUN apk add --no-cache git gcc g++ python
WORKDIR /app

COPY ./ ./

RUN npm ci --ignore-scripts --prefer-offline --silent --no-progress --no-audit
What am I missing?
n
@sagar lama did you add linux-musl to your binaryTarget ? If not, you should
s
where and how do I add linux-musl ?
n
@sagar lama
I think you should also run
npx prisma generate
in your Dockerfile after you've copied your app files
r
@sagar lama You donโ€™t need to add the
binaryTarget
directly, just run
npx prisma generate
in your
Dockerfile
and it will work.
Have a look at this example.
s
@Nathaniel Babalola I tried adding the same binaryTargets but got same error
@Ryan adding RUN npx prisma generate gave me the same error
when I use node:14 as the base image(not the alpine version) it works. What do I need to install for the prisma engine?
I'm new to prisma Also, I'm using nx workspace if it makes any difference
r
Did you install the packages required for alpine Check my Dockerfile and the RUN command for installing packages
n
@sagar lama also check you're not copying your node_modules folder, add it to your .dockerignore
e
Yesterday work correct, but today have this problem in locale machine and ci cd server
Source code full equals
For repeat this problem, remove node modules from project folder and install I use yarn for install, ubuntu 20, node 15.14.0
After it start project
Sorry I use docker for local development in node:14-alpine
r
Can you share your dockerfile?
e
I use docker compose, now I try run with 15 node Alpine, still not work booster-server: image: node:15-alpine user: ${CURRENT_UID} container_name: 'booster-server-service' env_file: - ../../env/local.env environment: - POSTGRES_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@booster-postgres:${POSTGRES_INTERNAL_PORT}/${POSTGRES_DATABASE}?schema=public working_dir: '/app' volumes: - ./../../:/app networks: - booster-network command: 'npm run nx serve server' tty: true depends_on: - booster-postgres - booster-redis
File exists, but not work(
Sorry I don't have prisma workspace in slack on my pc, only in phone ๐Ÿ“ธ ๐Ÿ™‚
Docker file for build image on ci cd
After change node:14-alpine to node:14 in docker compose, it is work correct, but image very large
If I use it in docker file for production ๐Ÿ˜ž
r
This is a known issue. You can revert to Prisma version
3.1.1
for the time being.
e
for now I use node:14
Thanks
s
Using the 14-alpine I'm not sure what needs to be installed Reverting the 3.1.1 did not solve the issue. I'm using node:14 as the base image to resolve the issue. Looks like it's more on docker side than on prisma. I will try to post an answer if I find anything