Invalid photon through Docker image
See original GitHub issueHi,
I’m trying to deploy my working web-app including a backend with prisma2.
But when i start the docker image, an error appears with the first “photon.mytable” call:
Invalid photon.() invocation in /usr/src/app/main.js
Reason: Error occurred during query execution: ConnectorError(ConnectorError { user_facing_error: None, kind: QueryError(SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("no such table: dev.mytable"))
This behavior looks like i didn’t generated the schema, but i did in dockerfile:
FROM node:12.9.1-stretch
LABEL name="myapp-back" version="0.1.0"
WORKDIR /usr/src/app
COPY ./package.json package.json
COPY ./yarn.lock yarn.lock
RUN yarn install --frozen-lockfile --prod
COPY ./tsconfig.json tsconfig.json
COPY ./prisma/schema.prisma prisma/schema.prisma
RUN yarn generate <-- calls "prisma2 generate" in package.json
COPY ./src src
RUN yarn build
COPY ./src/schema.graphql ./dist/schema.graphql
ENV NODE_ENV prod
EXPOSE 4000
CMD ["yarn", "start"]
Moreover, this backend works fine on my local machine (out of a Docker image).
For info, schema.prisma starts with:
generator photon {
provider = "photonjs"
binaryTargets = ["native", "debian-openssl-1.1.x"]
}
datasource db {
provider = "sqlite"
url = "file:dev.db"
}
Any idea ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8
Top Results From Across the Web
Docker image pull error invalid character - Stack Overflow
HI all.. The issue was due to the image was missing in the DTR.. the image was pushed to a different DTR in...
Read more >How to Fix and Debug Docker Containers Like a Superhero
Container errors are tricky to diagnose, but some investigative magic works wonders. Read along to learn how to debug Docker containers.
Read more >Image-building best practices - Docker Documentation
When you have built an image, it is a good practice to scan it for security vulnerabilities using the docker scan command. Docker...
Read more >Troubleshoot volume errors - Docker Documentation
This topic discusses errors which may occur when you use Docker volumes or bind mounts. Error: Unable to remove filesystem. Some container-based utilities, ......
Read more >Use macvlan networks - Docker Documentation
In this type of situation, you can use the macvlan network driver to assign a MAC address to each container's virtual network interface,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks, it works! 😃
The entire solution: 1- think to backup prisma/migrations at the initial state with
prisma2 lift save
2- use this Dockerfile:Be careful: this is a versatile server: each time you will reload your image, the database will be reset! Think to use an external image/service to keep data.
try
prisma2 lift up --auto-approve