configuration/ci/Dockerfile

31 lines
514 B
Docker
Raw Normal View History

2023-01-25 14:16:13 +00:00
###################
# 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 . .
# Create a "dist" folder
RUN npm run build
# Run unit tests
RUN npm run test:unit:ci
2023-03-30 08:42:38 +00:00
# ESLint / Prettier
RUN npm run lint:check
RUN npm run pretty:check
2023-01-25 14:16:13 +00:00
# Start the server
CMD [ "node", "dist/main.js" ]