diff --git a/README.md b/README.md index 5bbdef4..fc6a04c 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ services: entrypoint: /app/entrypoint.sh command: yarn pdp environment: - PRISMA_SCHEMA_PATH=/app/path/your/schema.prisma + PRISMA_SCHEMA_PATH: /app/for/your/schema.prisma DATABASE_URL: your DATABASE_URL DATA_PROXY_API_KEY: your DATA_PROXY_API_KEY PORT: "3000" @@ -140,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", "--"] diff --git a/docker-compose.yml b/docker-compose.yml index b604964..8370105 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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" diff --git a/src/server.ts b/src/server.ts index 325bd5f..2f78259 100644 --- a/src/server.ts +++ b/src/server.ts @@ -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),