mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	* feat: slim down docker container This changes the unleash-server node module to be as little as it can, resulting in a much smaller docker container. From 383M -> 11M.
		
			
				
	
	
		
			31 lines
		
	
	
		
			531 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			531 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
ARG NODE_VERSION=16-alpine
 | 
						|
FROM node:$NODE_VERSION as builder
 | 
						|
 | 
						|
RUN echo "Debug - node version: $NODE_VERSION "
 | 
						|
 | 
						|
WORKDIR /unleash
 | 
						|
 | 
						|
COPY . /unleash
 | 
						|
 | 
						|
RUN yarn install --frozen-lockfile --ignore-scripts && yarn run build && yarn run local:package
 | 
						|
 | 
						|
WORKDIR /unleash/docker
 | 
						|
 | 
						|
RUN yarn install --frozen-lockfile --production=true
 | 
						|
 | 
						|
FROM node:$NODE_VERSION
 | 
						|
 | 
						|
ENV NODE_ENV production
 | 
						|
 | 
						|
WORKDIR /unleash
 | 
						|
 | 
						|
COPY --from=builder /unleash/docker /unleash
 | 
						|
 | 
						|
RUN rm -rf /usr/local/lib/node_modules/npm/
 | 
						|
 | 
						|
EXPOSE 4242
 | 
						|
 | 
						|
USER node
 | 
						|
 | 
						|
CMD ["node", "index.js"]
 |