Skip to content

Commit

Permalink
feat: allow schema path to be specified by PRISMA_SCHEMA_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
aiji42 committed Jul 4, 2022
1 parent 80c9ca2 commit b5a7464
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ services:
entrypoint: /app/entrypoint.sh
command: yarn pdp
environment:
PRISMA_SCHEMA_PATH: /app/for/your/schema.prisma
DATABASE_URL: your DATABASE_URL
DATA_PROXY_API_KEY: your DATA_PROXY_API_KEY
PORT: "3000"
Expand Down Expand Up @@ -139,6 +140,8 @@ FROM base
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json

ENV PRISMA_SCHEMA_PATH=/app/node_modules/.prisma/client/schema.prisma

USER node

ENTRYPOINT ["/usr/bin/tini", "--"]
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
entrypoint: /app/entrypoint.sh
command: ./wait-for-it.sh https-portal3000:443 --timeout=120 --strict -- yarn dev:server
environment:
PRISMA_SCHEMA_PATH: /app/node_modules/.prisma/client/schema.prisma
DATABASE_URL: postgresql://postgres:pass@db:5432/postgres?schema=public
DATA_PROXY_API_KEY: custometoken
MIGRATE: "true"
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ app.use(afterMiddleware());

(async () => {
const dmmf = await getDMMF({
datamodel: getSchemaSync(),
datamodel: getSchemaSync(process.env.PRISMA_SCHEMA_PATH),
});
const server = new ApolloServer({
...makeServerConfig(dmmf, db),
Expand Down

0 comments on commit b5a7464

Please sign in to comment.