18 lines
		
	
	
		
			488 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			488 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
# Stage 1: Build
 | 
						|
FROM node:alpine AS build
 | 
						|
WORKDIR /build
 | 
						|
 | 
						|
## Install app dependencies
 | 
						|
COPY package*.json ./
 | 
						|
RUN npm install
 | 
						|
 | 
						|
## Bundle app source
 | 
						|
COPY . .
 | 
						|
 | 
						|
## Compile App
 | 
						|
RUN npm run build
 | 
						|
 | 
						|
# Stage 2: Package up with the webserver
 | 
						|
FROM nginx:alpine AS final
 | 
						|
COPY --from=build /build/dist/frontend /usr/share/nginx/html
 | 
						|
CMD ["/bin/sh",  "-c",  "envsubst < /usr/share/nginx/html/assets/env.template.js > /usr/share/nginx/html/assets/env.js && exec nginx -g 'daemon off;'"] |