mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	## About the changes This upgrades our main branch to use node 18 which is the active LTS version and stops using node 14 which reaches the end of life in a few weeks: https://nodejs.dev/en/about/releases/ This PR also adds `--no-experimental-fetch` for frontend tests and other frontend commands. Related to: https://github.com/node-fetch/node-fetch/issues/1566 More about the experimental fetch release: https://nodejs.org/en/blog/announcements/v18-release-announce#fetch-experimental
		
			
				
	
	
		
			42 lines
		
	
	
		
			763 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			763 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
| ARG NODE_VERSION=18-alpine
 | |
| 
 | |
| FROM --platform=$BUILDPLATFORM node:$NODE_VERSION as frontend_builder
 | |
| 
 | |
| WORKDIR /unleash/frontend
 | |
| 
 | |
| COPY . /unleash
 | |
| 
 | |
| RUN yarn install --frozen-lockfile
 | |
| 
 | |
| FROM node:$NODE_VERSION as builder
 | |
| 
 | |
| WORKDIR /unleash
 | |
| 
 | |
| COPY . /unleash
 | |
| 
 | |
| RUN yarn config set network-timeout 300000
 | |
| 
 | |
| RUN yarn install --frozen-lockfile --ignore-scripts  && yarn run build && yarn run local:package
 | |
| 
 | |
| COPY --from=frontend_builder /unleash/frontend/build /unleash/build/frontend/build
 | |
| 
 | |
| 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"]
 |