2 changed files with 46 additions and 0 deletions
			
			
		@ -0,0 +1,42 @@ | 
				
			|||||
 | 
					# Build stage | 
				
			||||
 | 
					FROM node:20-alpine AS builder | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					# Install build dependencies | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					RUN apk add --no-cache \ | 
				
			||||
 | 
					    python3 \ | 
				
			||||
 | 
					    py3-pip \ | 
				
			||||
 | 
					    py3-setuptools \ | 
				
			||||
 | 
					    make \ | 
				
			||||
 | 
					    g++ \ | 
				
			||||
 | 
					    gcc | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					# Set working directory | 
				
			||||
 | 
					WORKDIR /app | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					# Copy package files | 
				
			||||
 | 
					COPY package*.json ./ | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					# Install dependencies | 
				
			||||
 | 
					RUN npm ci | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					# Copy source code | 
				
			||||
 | 
					COPY . . | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					# Build the application | 
				
			||||
 | 
					RUN npm run build:web | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					# Production stage | 
				
			||||
 | 
					FROM nginx:alpine | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					# Copy built assets from builder stage | 
				
			||||
 | 
					COPY --from=builder /app/dist /usr/share/nginx/html | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					# Copy nginx configuration if needed | 
				
			||||
 | 
					# COPY nginx.conf /etc/nginx/conf.d/default.conf | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					# Expose port 80 | 
				
			||||
 | 
					EXPOSE 80 | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					# Start nginx | 
				
			||||
 | 
					CMD ["nginx", "-g", "daemon off;"]  | 
				
			||||
@ -0,0 +1,4 @@ | 
				
			|||||
 | 
					#!/bin/bash | 
				
			||||
 | 
					export IMAGENAME="$(basename $PWD):1.0" | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					docker build . --network=host -t $IMAGENAME --no-cache | 
				
			||||
					Loading…
					
					
				
		Reference in new issue