user/ci/Dockerfile

30 lines
530 B
Docker
Raw Normal View History

2023-01-09 14:08:45 +00:00
###################
2023-01-10 07:54:29 +00:00
# BUILD FOR CI TESTING
2023-01-09 14:08:45 +00:00
###################
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
2023-01-10 08:04:37 +00:00
# Execute prisma migration
RUN npm run migrate-test-ci
2023-01-10 07:54:29 +00:00
# Execute unit tests
2023-01-09 15:59:19 +00:00
RUN npm run test:unit
2023-01-10 07:54:29 +00:00
# Start the server using the production build
CMD [ "node", "dist/main.js" ]