change registry
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
.git
|
.git
|
||||||
|
!deploy-dist.tar.gz
|
||||||
.env.development
|
.env.development
|
||||||
.env.production
|
.env.production
|
||||||
.env.local
|
.env.local
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
VITE_API_BASE_URL=https://nademitex.montest.ir/server/api
|
VITE_API_BASE_URL=https://nademitex.montest.ir/server/api
|
||||||
|
VITE_USE_MOCK_AUTH=false
|
||||||
|
VITE_BASE_PATH=/
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
registry=https://registry.npmjs.org
|
registry=https://mirror2.chabokan.net/npm/
|
||||||
replace-registry-host=always
|
replace-registry-host=npmjs
|
||||||
legacy-peer-deps=true
|
legacy-peer-deps=true
|
||||||
fetch-retries=5
|
|
||||||
fetch-retry-mintimeout=20000
|
|
||||||
fetch-retry-maxtimeout=120000
|
|
||||||
fetch-timeout=60000
|
|
||||||
maxsockets=10
|
|
||||||
|
|||||||
+9
-8
@@ -1,19 +1,20 @@
|
|||||||
FROM node:22
|
FROM docker.iranserver.com/node:20
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json package-lock.json .npmrc ./
|
COPY package.json package-lock.json .npmrc ./
|
||||||
COPY scripts ./scripts
|
COPY scripts ./scripts
|
||||||
|
|
||||||
ENV NPM_CONFIG_REGISTRY=https://registry.npmjs.org
|
ENV NPM_CONFIG_REGISTRY=https://mirror2.chabokan.net/npm/
|
||||||
ENV NPM_CONFIG_FETCH_RETRIES=5
|
RUN npm config set registry https://mirror2.chabokan.net/npm/ \
|
||||||
ENV NPM_CONFIG_FETCH_RETRY_MINTIMEOUT=20000
|
&& npm config set replace-registry-host npmjs \
|
||||||
ENV NPM_CONFIG_FETCH_RETRY_MAXTIMEOUT=120000
|
&& npm config set fetch-retry-mintimeout 10000 \
|
||||||
ENV NPM_CONFIG_FETCH_TIMEOUT=60000
|
&& npm config set fetch-retry-maxtimeout 120000 \
|
||||||
ENV NPM_CONFIG_MAXSOCKETS=10
|
&& npm config set fetch-timeout 120000 \
|
||||||
|
&& npm config set fetch-retries 5
|
||||||
|
|
||||||
ENV NODE_ENV=development
|
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 . .
|
COPY . .
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -8,6 +8,7 @@
|
|||||||
"build": "run-p type-check \"build-only {@}\" --",
|
"build": "run-p type-check \"build-only {@}\" --",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"build-only": "vite build",
|
"build-only": "vite build",
|
||||||
|
"pack:docker": "node scripts/pack-docker.mjs",
|
||||||
"type-check": "vue-tsc --build",
|
"type-check": "vue-tsc --build",
|
||||||
"lint": "run-s \"lint:*\"",
|
"lint": "run-s \"lint:*\"",
|
||||||
"lint:oxlint": "oxlint . --fix",
|
"lint:oxlint": "oxlint . --fix",
|
||||||
|
|||||||
@@ -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}`)
|
||||||
Reference in New Issue
Block a user