# Prisma engines mirror (pkg.shecan.ir)

> Mirror of binaries.prisma.sh (PRISMA_ENGINES_MIRROR): the Prisma ORM engine files (schema-engine; query-engine and the Node-API library in Prisma 6 and older) with their .sha256 files, downloaded by npm install, prisma generate and prisma migrate.

- Upstream: binaries.prisma.sh
- Mirror URL: <https://mirror-prisma.pkg.shecan.ir/>
- Clients: prisma
- Service status: <https://pkg.shecan.ir/status.json> (key `prisma`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/prisma/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/prisma.json>

## Limitations

- The prisma and @prisma/client packages themselves come from the npm mirror.
- PRISMA_ENGINES_MIRROR must be set where the engines are downloaded: in the shell or CI job before npm install, and with ENV in a Dockerfile; Prisma does not read it from the project .env file during npm install.
- Prisma Accelerate, Prisma Postgres and Prisma Studio online are cloud services and are not mirrored.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### prisma: persistent (user- or system-wide configuration)

Run (linux, macos)

```sh
export PRISMA_ENGINES_MIRROR=https://mirror-prisma.pkg.shecan.ir
npm install
```

Undo / restore the default (linux, macos)

```sh
unset PRISMA_ENGINES_MIRROR
sed -i.bak -E '/^export (PRISMA_ENGINES_MIRROR)=/d' ~/.bashrc ~/.zshrc ~/.profile 2>/dev/null || true
```

Run (windows) (checked by hand)

```powershell
[Environment]::SetEnvironmentVariable('PRISMA_ENGINES_MIRROR', 'https://mirror-prisma.pkg.shecan.ir', 'User')
```

Undo / restore the default (windows) (checked by hand)

```powershell
[Environment]::SetEnvironmentVariable('PRISMA_ENGINES_MIRROR', $null, 'User')
```

### prisma: project (files inside the project)

Example, Dockerfile (checked by hand)

```dockerfile
FROM node:22
ENV PRISMA_ENGINES_MIRROR=https://mirror-prisma.pkg.shecan.ir
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npx prisma generate
```
