change registry

This commit is contained in:
2026-09-10 13:08:51 +03:30
parent bfc449dd79
commit 92e7dd1417
7 changed files with 33 additions and 15 deletions
+1
View File
@@ -1,6 +1,7 @@
node_modules
dist
.git
!deploy-dist.tar.gz
.env.development
.env.production
.env.local
+2
View File
@@ -1 +1,3 @@
VITE_API_BASE_URL=https://nademitex.montest.ir/server/api
VITE_USE_MOCK_AUTH=false
VITE_BASE_PATH=/
+2 -7
View File
@@ -1,8 +1,3 @@
registry=https://registry.npmjs.org
replace-registry-host=always
registry=https://mirror2.chabokan.net/npm/
replace-registry-host=npmjs
legacy-peer-deps=true
fetch-retries=5
fetch-retry-mintimeout=20000
fetch-retry-maxtimeout=120000
fetch-timeout=60000
maxsockets=10
+9 -8
View File
@@ -1,19 +1,20 @@
FROM node:22
FROM docker.iranserver.com/node:20
WORKDIR /app
COPY package.json package-lock.json .npmrc ./
COPY scripts ./scripts
ENV NPM_CONFIG_REGISTRY=https://registry.npmjs.org
ENV NPM_CONFIG_FETCH_RETRIES=5
ENV NPM_CONFIG_FETCH_RETRY_MINTIMEOUT=20000
ENV NPM_CONFIG_FETCH_RETRY_MAXTIMEOUT=120000
ENV NPM_CONFIG_FETCH_TIMEOUT=60000
ENV NPM_CONFIG_MAXSOCKETS=10
ENV NPM_CONFIG_REGISTRY=https://mirror2.chabokan.net/npm/
RUN npm config set registry https://mirror2.chabokan.net/npm/ \
&& npm config set replace-registry-host npmjs \
&& npm config set fetch-retry-mintimeout 10000 \
&& npm config set fetch-retry-maxtimeout 120000 \
&& npm config set fetch-timeout 120000 \
&& npm config set fetch-retries 5
ENV NODE_ENV=development
RUN npm ci --include=dev --foreground-scripts --no-audit --no-fund --legacy-peer-deps
RUN npm ci --include=dev --foreground-scripts --no-audit --no-fund --legacy-peer-deps --registry=https://mirror2.chabokan.net/npm/
COPY . .
Binary file not shown.
+1
View File
@@ -8,6 +8,7 @@
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"build-only": "vite build",
"pack:docker": "node scripts/pack-docker.mjs",
"type-check": "vue-tsc --build",
"lint": "run-s \"lint:*\"",
"lint:oxlint": "oxlint . --fix",
+18
View File
@@ -0,0 +1,18 @@
import { execSync } from 'node:child_process'
import { existsSync } from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
process.chdir(root)
execSync('node scripts/write-docker-vite-env.mjs', { stdio: 'inherit' })
execSync('npm run build-only', { stdio: 'inherit' })
if (!existsSync(path.join(root, 'dist', 'index.html'))) {
throw new Error('dist/index.html ساخته نشد')
}
const out = 'deploy-dist.tar.gz'
execSync(`tar -czf ${out} dist scripts/serve-user.mjs`, { stdio: 'inherit' })
console.log(`packed ${out}`)