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