fix: docker + exdev error

This commit is contained in:
diced
2025-08-07 15:26:47 -07:00
parent 2e70cf0add
commit 09e445b9ae
6 changed files with 30 additions and 17 deletions

View File

@@ -17,10 +17,8 @@ body:
label: Version
description: What version (or docker image) of Zipline are you using?
options:
- Latest v4 release (ghcr.io/diced/zipline or ghcr.io/diced/zipline:latest)
- Latest v4 commit (ghcr.io/diced/zipline:trunk)
- Latest v3 release (ghcr.io/diced/zipline:v3)
- Latest v3 commit (ghcr.io/diced/zipline:v3-trunk)
- Latest release (ghcr.io/diced/zipline or ghcr.io/diced/zipline:latest)
- Latest commit (ghcr.io/diced/zipline:trunk)
- other (provide version in additional info)
validations:
required: true
@@ -33,13 +31,14 @@ body:
- Firefox
- Chromium-based (Chrome, Edge, Brave, Opera, mobile chrome/chromium based, etc)
- Safari
- Chromium-based Mobile (Chrome, Edge, Brave, Android WebView, etc)
- Firefox Mobile
- Safari Mobile
- type: textarea
id: zipline-logs
attributes:
label: Zipline Logs
description: Please copy and paste any relevant log output. Not seeing anything interesting? Try adding the `DEBUG=zipline` (v4) or `DEBUG=true` (v3) environment variable to see more logs, make sure to review the output and remove any sensitive information as it can be VERY verbose at times.
description: Please copy and paste any relevant log output. Not seeing anything interesting? Try adding the `DEBUG=zipline` (v4) environment variable to see more logs, make sure to review the output and remove any sensitive information as it can be VERY verbose at times.
render: shell
- type: textarea
id: browser-logs

View File

@@ -39,7 +39,7 @@ jobs:
${{ steps.pnpm-cache.outputs.store_path }}
key: ${{ runner.os }}-${{ matrix.arch }}-${{ matrix.node }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.node }}-pnpm-store-${{ hashFiles('**/package-lock.json') }}-
${{ runner.os }}-${{ matrix.arch }}-${{ matrix.node }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-
- name: Install
run: pnpm install

View File

@@ -20,11 +20,17 @@ FROM base AS builder
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY src ./src
COPY next.config.js ./next.config.js
COPY .gitignore ./.gitignore
COPY postcss.config.cjs ./postcss.config.cjs
COPY prettier.config.cjs ./prettier.config.cjs
COPY eslint.config.mjs ./eslint.config.mjs
COPY vite.config.ts ./vite.config.ts
COPY tsup.config.ts ./tsup.config.ts
COPY tsconfig.json ./tsconfig.json
COPY mimes.json ./mimes.json
COPY code.json ./code.json
COPY vite-env.d.ts ./vite-env.d.ts
ENV NEXT_TELEMETRY_DISABLED=1 \
NODE_ENV=production
@@ -36,12 +42,9 @@ FROM base
COPY --from=deps /zipline/node_modules ./node_modules
COPY --from=builder /zipline/build ./build
COPY --from=builder /zipline/.next ./.next
COPY --from=builder /zipline/mimes.json ./mimes.json
COPY --from=builder /zipline/code.json ./code.json
COPY --from=builder /zipline/generated ./generated
RUN pnpm build:prisma

View File

@@ -87,6 +87,7 @@
"sharp": "^0.34.3",
"swr": "^2.3.4",
"typescript-eslint": "^8.39.0",
"vite": "^7.1.0",
"zod": "^3.25.67",
"zustand": "^5.0.7"
},
@@ -117,8 +118,7 @@
"tsc-alias": "^1.8.16",
"tsup": "^8.5.0",
"tsx": "^4.20.3",
"typescript": "^5.9.2",
"vite": "^7.1.0"
"typescript": "^5.9.2"
},
"engines": {
"node": ">=22"

6
pnpm-lock.yaml generated
View File

@@ -176,6 +176,9 @@ importers:
typescript-eslint:
specifier: ^8.39.0
version: 8.39.0(eslint@9.32.0(jiti@2.5.1))(typescript@5.9.2)
vite:
specifier: ^7.1.0
version: 7.1.0(@types/node@24.2.0)(jiti@2.5.1)(sass@1.90.0)(sugarss@5.0.1(postcss@8.5.6))(tsx@4.20.3)
zod:
specifier: ^3.25.67
version: 3.25.67
@@ -264,9 +267,6 @@ importers:
typescript:
specifier: ^5.9.2
version: 5.9.2
vite:
specifier: ^7.1.0
version: 7.1.0(@types/node@24.2.0)(jiti@2.5.1)(sass@1.90.0)(sugarss@5.0.1(postcss@8.5.6))(tsx@4.20.3)
packages:

View File

@@ -1,5 +1,5 @@
import { createReadStream, existsSync } from 'fs';
import { access, constants, readdir, rename, rm, stat, writeFile } from 'fs/promises';
import { access, constants, copyFile, readdir, rename, rm, stat, writeFile } from 'fs/promises';
import { join } from 'path';
import { Readable } from 'stream';
import { Datasource } from './Datasource';
@@ -40,7 +40,18 @@ export class LocalDatasource extends Datasource {
"Something went very wrong! the temporary directory wasn't readable or the file doesn't exist.",
);
return rename(data, path);
try {
await rename(data, path);
} catch (err) {
// docker may throw exdev errors when renaming across volumes (/tmp to something else)
if ((err as NodeJS.ErrnoException).code === 'EXDEV') {
await copyFile(data, path);
await rm(data);
return;
} else {
throw err;
}
}
}
return writeFile(path, data);