29 lines
		
	
	
		
			623 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			623 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
FROM node:lts-alpine
 | 
						|
 | 
						|
# installer les dépendances système nécessaires pour build Vue
 | 
						|
RUN apk add --no-cache python3 make g++ git
 | 
						|
 | 
						|
# installe http-server globalement
 | 
						|
RUN npm install -g http-server
 | 
						|
 | 
						|
# définit le dossier de travail
 | 
						|
WORKDIR /app
 | 
						|
 | 
						|
# copie package.json et package-lock.json
 | 
						|
COPY package*.json ./
 | 
						|
 | 
						|
# installe les dépendances du projet
 | 
						|
RUN npm install
 | 
						|
 | 
						|
# copie tout le projet
 | 
						|
COPY . .
 | 
						|
 | 
						|
# construit l'app pour la production
 | 
						|
RUN npm run build
 | 
						|
 | 
						|
# expose le port
 | 
						|
EXPOSE 4001
 | 
						|
 | 
						|
# lance http-server sur dist avec redirection pour Vue Router
 | 
						|
CMD ["http-server", "dist", "-p", "4001", "-P", "http://localhost:4001?/"]
 |