33 lines
		
	
	
		
			575 B
		
	
	
	
		
			Docker
		
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			575 B
		
	
	
	
		
			Docker
		
	
	
	
###################
 | 
						|
# BUILD FOR CI TESTING
 | 
						|
###################
 | 
						|
 | 
						|
FROM node:18-alpine3.16
 | 
						|
 | 
						|
# Create app directory
 | 
						|
WORKDIR /usr/src/app
 | 
						|
 | 
						|
# A wildcard is used to ensure both package.json AND package-lock.json are copied
 | 
						|
COPY package*.json ./
 | 
						|
 | 
						|
# Install app dependencies
 | 
						|
RUN npm ci
 | 
						|
 | 
						|
# Bundle app source
 | 
						|
COPY . .
 | 
						|
 | 
						|
# Creates a "dist" folder
 | 
						|
RUN npm run build
 | 
						|
 | 
						|
# Creates a "dist" folder
 | 
						|
RUN npm run build
 | 
						|
 | 
						|
# Execute prisma migration
 | 
						|
RUN npm run migrate-test-ci
 | 
						|
 | 
						|
# Execute unit tests
 | 
						|
RUN npm run test:unit
 | 
						|
 | 
						|
# Start the server using the production build
 | 
						|
CMD [ "node", "dist/main.js" ]
 |