try new dockerfile
This commit is contained in:
		
							
								
								
									
										20
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -1,14 +1,26 @@ | ||||
| # Use an official Node.js runtime as a parent image | ||||
| FROM node:18-alpine | ||||
|  | ||||
| # Set the working directory | ||||
| WORKDIR /app | ||||
|  | ||||
| COPY package.json . | ||||
| # Copy package.json and package-lock.json | ||||
| COPY package*.json ./ | ||||
|  | ||||
| # Install dependencies | ||||
| RUN npm install | ||||
| RUN npm install -g serve | ||||
|  | ||||
| # Copy the rest of the application code | ||||
| COPY . . | ||||
|  | ||||
| # Build the application | ||||
| RUN npm run build | ||||
|  | ||||
| EXPOSE 3000 | ||||
| # Install a lightweight web server | ||||
| RUN npm install -g serve | ||||
|  | ||||
| CMD ["serve", "-s", "dist", "-l", "3000"] | ||||
| # Set the command to run the web server | ||||
| CMD ["serve", "-s", "dist"] | ||||
|  | ||||
| # Expose the port the app runs on | ||||
| EXPOSE 3000 | ||||
		Reference in New Issue
	
	Block a user