again
This commit is contained in:
		
							
								
								
									
										14
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -1,15 +1,17 @@ | |||||||
| # Production stage | FROM node:18-alpine | ||||||
| FROM node:18-alpine as production |  | ||||||
|  |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
|  |  | ||||||
| # Install serve globally | COPY package.json . | ||||||
|  | RUN npm install | ||||||
| RUN npm install -g serve | RUN npm install -g serve | ||||||
|  |  | ||||||
| # Copy built files from build stage | COPY . . | ||||||
|  | RUN npm run build | ||||||
|  |  | ||||||
| COPY --from=build /app/dist ./dist | COPY --from=build /app/dist ./dist | ||||||
|  |  | ||||||
| EXPOSE 3000 | EXPOSE 3000 | ||||||
|  |  | ||||||
| # Use the -s flag to handle SPA routing | # Serve the static files after building | ||||||
| CMD ["serve", "-s", "dist", "-l", "3000"] | CMD ["serve", "-s", "dist", "-l", "3000"] | ||||||
		Reference in New Issue
	
	Block a user