forked from mirrors/amnezia-wg-easy
		
	Reduce docker image size
This commit is contained in:
		
							parent
							
								
									bd3652c184
								
							
						
					
					
						commit
						50add72345
					
				
					 1 changed files with 10 additions and 7 deletions
				
			
		
							
								
								
									
										17
									
								
								Dockerfile
									
										
									
									
									
								
							
							
						
						
									
										17
									
								
								Dockerfile
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -6,7 +6,8 @@ FROM docker.io/library/node:18-alpine AS build_node_modules
 | 
			
		|||
# Copy Web UI
 | 
			
		||||
COPY src/ /app/
 | 
			
		||||
WORKDIR /app
 | 
			
		||||
RUN npm ci --omit=dev
 | 
			
		||||
RUN npm ci --omit=dev &&\
 | 
			
		||||
    mv node_modules /node_modules
 | 
			
		||||
 | 
			
		||||
# Copy build result to a new image.
 | 
			
		||||
# This saves a lot of disk space.
 | 
			
		||||
| 
						 | 
				
			
			@ -20,13 +21,15 @@ COPY --from=build_node_modules /app /app
 | 
			
		|||
# Also, some node_modules might be native, and
 | 
			
		||||
# the architecture & OS of your development machine might differ
 | 
			
		||||
# than what runs inside of docker.
 | 
			
		||||
RUN mv /app/node_modules /node_modules
 | 
			
		||||
COPY --from=build_node_modules /node_modules /node_modules
 | 
			
		||||
 | 
			
		||||
# Enable this to run `npm run serve`
 | 
			
		||||
RUN npm i -g nodemon
 | 
			
		||||
 | 
			
		||||
# Workaround CVE-2023-42282
 | 
			
		||||
RUN npm uninstall -g ip
 | 
			
		||||
RUN \
 | 
			
		||||
    # Enable this to run `npm run serve`
 | 
			
		||||
    npm i -g nodemon &&\
 | 
			
		||||
    # Workaround CVE-2023-42282
 | 
			
		||||
    npm uninstall -g ip &&\
 | 
			
		||||
    # Delete unnecessary files 
 | 
			
		||||
    npm cache clean --force && rm -rf ~/.npm
 | 
			
		||||
 | 
			
		||||
# Install Linux packages
 | 
			
		||||
RUN apk add --no-cache \
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue