Reduce docker image size #62
			
				
			
		
		
		
	|  | @ -0,0 +1,5 @@ | ||||||
|  | node_modules | ||||||
|  | .git | ||||||
|  | .gitignore | ||||||
|  | .next | ||||||
|  | package-lock.json | ||||||
							
								
								
									
										22
									
								
								Dockerfile
								
								
								
								
							
							
						
						
									
										22
									
								
								Dockerfile
								
								
								
								
							|  | @ -1,23 +1,21 @@ | ||||||
| # Usa la versione alpine più recente di Node.js compatibile con Next.js 14 come base | # PHASE 1: copy and build | ||||||
| FROM node:alpine | 
 | ||||||
|  | FROM node:alpine AS build | ||||||
| 
 | 
 | ||||||
| # Imposta la directory di lavoro nel container |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| 
 | 
 | ||||||
| # Copia i file esistenti nella root del progetto nel container |  | ||||||
| COPY . . | COPY . . | ||||||
| 
 | 
 | ||||||
| # Rimuovi la cartella node_modules (se presente) | RUN rm -rf node_modules && npm install && npm run build | ||||||
| RUN rm -rf node_modules |  | ||||||
| 
 | 
 | ||||||
| # Installa le dipendenze | # PHASE 2: prepare for exec | ||||||
| RUN npm install |  | ||||||
| 
 | 
 | ||||||
| # Esegui la build del progetto | FROM node:alpine AS exec | ||||||
| RUN npm run build | 
 | ||||||
|  | WORKDIR /app | ||||||
|  | 
 | ||||||
|  | COPY --from=build /app/. . | ||||||
| 
 | 
 | ||||||
| # Esponi la porta 3000 |  | ||||||
| EXPOSE 3000 | EXPOSE 3000 | ||||||
| 
 | 
 | ||||||
| # Avvia il server in modalità di produzione |  | ||||||
| CMD ["npm", "run", "start"] | CMD ["npm", "run", "start"] | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| { | { | ||||||
|   "name": "proxyraye-next", |   "name": "proxyraye-next", | ||||||
|   "version": "0.1.0", |   "version": "0.2.0", | ||||||
|   "private": true, |   "private": true, | ||||||
|   "scripts": { |   "scripts": { | ||||||
|     "dev": "next dev", |     "dev": "next dev", | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue