added docker config
This commit is contained in:
		
							parent
							
								
									96ccd7faa0
								
							
						
					
					
						commit
						ad57e0685e
					
				
					 3 changed files with 45 additions and 0 deletions
				
			
		
							
								
								
									
										6
									
								
								.dockerignore
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								.dockerignore
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,6 @@
 | 
				
			||||||
 | 
					node_modules
 | 
				
			||||||
 | 
					dist
 | 
				
			||||||
 | 
					.git
 | 
				
			||||||
 | 
					.github
 | 
				
			||||||
 | 
					.gitignore
 | 
				
			||||||
 | 
					README.md
 | 
				
			||||||
							
								
								
									
										31
									
								
								Dockerfile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								Dockerfile
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,31 @@
 | 
				
			||||||
 | 
					# Build stage
 | 
				
			||||||
 | 
					FROM oven/bun:latest as build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WORKDIR /app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Copy package files and install dependencies
 | 
				
			||||||
 | 
					COPY package.json bun.lockb* ./
 | 
				
			||||||
 | 
					RUN bun install --frozen-lockfile
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Copy all files
 | 
				
			||||||
 | 
					COPY . .
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Build the app
 | 
				
			||||||
 | 
					RUN bun run build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Serve stage with Bun
 | 
				
			||||||
 | 
					FROM oven/bun:latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WORKDIR /app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Install a simple HTTP server
 | 
				
			||||||
 | 
					RUN bun add serve
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Copy built assets from build stage
 | 
				
			||||||
 | 
					COPY --from=build /app/dist /app/dist
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Expose port
 | 
				
			||||||
 | 
					EXPOSE 3000
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Start the static file server
 | 
				
			||||||
 | 
					CMD ["bunx", "serve", "dist", "-s", "-p", "3000"]
 | 
				
			||||||
							
								
								
									
										8
									
								
								docker-compose.yml
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								docker-compose.yml
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,8 @@
 | 
				
			||||||
 | 
					version: "3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					services:
 | 
				
			||||||
 | 
					  searchlock:
 | 
				
			||||||
 | 
					    build: .
 | 
				
			||||||
 | 
					    ports:
 | 
				
			||||||
 | 
					      - "5345:3000"
 | 
				
			||||||
 | 
					    restart: unless-stopped
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue