AntDX316 commited on
Commit
2892299
·
1 Parent(s): 7bb1512
Files changed (3) hide show
  1. .npmrc +6 -0
  2. Dockerfile +12 -3
  3. docker-compose.yml +2 -2
.npmrc ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ registry=https://registry.npmjs.org/
2
+ strict-ssl=false
3
+ fetch-retry-maxtimeout=60000
4
+ fetch-retry-mintimeout=10000
5
+ fetch-retries=5
6
+ network-timeout=100000
Dockerfile CHANGED
@@ -2,10 +2,19 @@ FROM node:18-alpine as build
2
 
3
  WORKDIR /app
4
 
5
- COPY package*.json ./
6
- RUN npm ci
7
-
8
  COPY . .
 
 
 
 
 
 
 
 
 
 
 
9
  RUN npm run build
10
 
11
  FROM nginx:alpine
 
2
 
3
  WORKDIR /app
4
 
5
+ # Copy all files directly
 
 
6
  COPY . .
7
+
8
+ # Configure npm to use alternative registry or retry options
9
+ RUN npm config set registry https://registry.npmjs.org/
10
+ RUN npm config set fetch-retry-maxtimeout 60000
11
+ RUN npm config set fetch-retry-mintimeout 10000
12
+ RUN npm config set fetch-retries 5
13
+
14
+ # Install dependencies with fallback options
15
+ RUN npm install || npm install --legacy-peer-deps || npm install --no-fund --no-audit
16
+
17
+ # Build the application
18
  RUN npm run build
19
 
20
  FROM nginx:alpine
docker-compose.yml CHANGED
@@ -14,10 +14,10 @@ services:
14
  - NODE_ENV=development
15
  restart: unless-stopped
16
 
17
- # Optional development service to support hot-reloading
18
  dev:
19
  image: node:18-alpine
20
- command: sh -c "npm ci && npm run dev"
21
  ports:
22
  - "5173:5173"
23
  working_dir: /app
 
14
  - NODE_ENV=development
15
  restart: unless-stopped
16
 
17
+ # Development service with fallback options for npm
18
  dev:
19
  image: node:18-alpine
20
+ command: sh -c "npm config set registry https://registry.npmjs.org/ && npm config set strict-ssl false && npm install --no-fund --no-audit && npm run dev"
21
  ports:
22
  - "5173:5173"
23
  working_dir: /app